If I understand your question, you are asking how does Android know
you want to launch the NoteEdit activity, right?
In the code, you see the line
Intent i = new Intent(this, NoteEdit.class);
and then a few lines below,
startActivityForResult(i, ACTIVITY_EDIT);
So variable i knows you intend to do something with the NoteEdit
class, and startActivity() uses that information.
Does that answer your question?
Yusuf Saib
Android
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.
On Jul 18, 1:46 am, Jose Ayerdis <[email protected]> wrote:
> I was reading the NotepadV2 app the following code...
>
> super.onListItemClick(l, v, position, id);
> Cursor c = mNotesCursor;
> c.moveToPosition(position);
> Intent i = new Intent(this, NoteEdit.class);
> i.putExtra(NotesDbAdapter.KEY_ROWID, id);
>
> i.putExtra(NotesDbAdapter.KEY_TITLE, c.getString(
> c.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE)));
> i.putExtra(NotesDbAdapter.KEY_BODY, c.getString(
> c.getColumnIndexOrThrow(NotesDbAdapter.KEY_BODY)));
>
> startActivityForResult(i, ACTIVITY_EDIT);
>
> And wonder how does the method set the correct id, i mean i never told it
> who was the id, how does it know can somebody explainme???
>
> --
> Atte
>
> [[Jose Luis Ayerdis Espinoza]]http://blognecronet.blogspot.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---