This was a good question (as it is something I was looking for
myself).
One super basic question: How do I get a handle to the calling Intent
in the called activity?
I create the intent in the first Activity with Intent i = new Intent
(); etc, but I am unclear on how I retrieve a handle to the calling
intent in the new Activity.
I am looking for something like this:
public NewActivity extends Activity {
...
Intent calledIntent = this.getCallingIntent(); //this is where I
would like to retrieve the handle to intent that was used
//
to start this Activity
//so I can call
String myData = calledIntent.getExtra("someData");
}
--Maybe I need to purchase your book as well ;-)
On Jun 18, 8:49 pm, "Mark Murphy" <[email protected]> wrote:
> > I have a situation where an activity needs to know where it was
> > started from,
> > so it knows what data to display in that current activity.
>
> Put an "extra" in the Intent that launches it that specifies its origin
> (e.g., putExtra(ORIGIN_KEY, STARTED_FROM_HERE); versus
> putExtra(ORIGIN_KEY, STARTED_FROM_THERE)). Then, examine the extra in the
> launched activity (e.g., getExtra(ORIGIN_KEY)).
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 2.0 Available!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---