getExtras method returns a data type Bundle. You can use this bundle to
retrieve your parameters passed from calling activity.
e.g . here is the code form Notepad tutorial
*
protected
* *void* onActivityResult(*int* requestCode, *int* resultCode, Intent
intent) {
*super*.onActivityResult(requestCode, resultCode, intent);
Bundle extras = intent.getExtras(); *// this is
where u retrive a bundle *
*switch*(requestCode) {
*case* *ACTIVITY_CREATE*:
String title = extras.getString(NotesDbAdapter.
*KEY_TITLE*); * // Now u retirve parameters using budle variable *
String body = extras.getString(NotesDbAdapter.
*KEY_BODY*);
mDbHelper.createNote(title, body);
fillData();
*break*;
*case* *ACTIVITY_EDIT*:
Long rowId = extras.getLong(NotesDbAdapter.
*KEY_ROWID*);
*if* (rowId != *null*) {
String editTitle = extras.getString(NotesDbAdapter.
*KEY_TITLE*);
String editBody = extras.getString(NotesDbAdapter.
*KEY_BODY*);
mDbHelper.updateNote(rowId, editTitle, editBody);
}
fillData();
*break*;
}
}
On Fri, Jul 24, 2009 at 5:46 AM, Jason Vinson <[email protected]> wrote:
>
> Per the tutorials on the site, getExtras is a way to pass a Bundle
> with an Intent. Think of it as passing extra properties along with
> the signal (the Intent) that can be used by the receiver.
>
> Jason
>
> On Jul 23, 4:14 pm, saurabh sinha <[email protected]> wrote:
> >
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---