On Wed, Sep 1, 2010 at 9:45 AM, kamiseq <[email protected]> wrote:

> just one more thing, what is the difference between startActivity
> and startActivityForResult,
>

The latter will call the onActivityResult on the first activity after the
second activity it started finishes.

can I have two activities of the same class on a stack displaying ie list
> with different data each?
>

Yes, but it depends on your launch flags and the intents used to start the
activities.


>  in another words what android really does when startActivity is called,
> does it resume or create activity and reload all data view needed so I can
> have only one activity of a given class or is it always creating new
> instance of the activity no matter there is one already created.
>

Again, depends on your launch flags and intents used to start
the activities.


> from my point of view when startActivityForResult is used android for sure
> must preserve caller's state as app will eventually return to caller with
> result.
>

Not necessarily. Preserving state is up to you. Android can and will kill
the parent activity if it needs to. When the child activity finishes and it
has to return to the calling activity, it will be restarted first and then
have it's onActivityResult() method called. It's up to you to ensure it's
ready for the data it gets back.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
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

Reply via email to