This suggestion is correct- use the intent "extras" to send your own
data back-and-forth to the sub-launched activity.  Here are a couple
of things to consider:

(1)  If at all possible, the sub activity should not crash if expected
extras data is not found in the launching intent.  (Null pointer
exceptions are very common in this area.)  Launch with defaults if
possible;  Or finish() immediately (perhaps after a dialog warning.)
This makes it more resilient to unexpected launch conditions like
being launched from AnyCut, launched by a testing monkey, or your own
test code.

(2)  When passing data between activities, be extremely careful that
you don't include references to the activity objects themselves - this
can cause memory leaks.  Make sure that any objects you pass between
activities are self-contained.  (The common mistake here is to use
inner classes that are not "static".)

Hope this helps.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to