Sunday, August 28, 2011

[android-developers] Activity comms

Hi all,

I start Activity B from Activity A using:

Intent intent = new Intent();
intent.setClass(androidContext, org.myActB..class);
intent.setFlags(intent.FLAG_ACTIVITY_SINGLE_TASK);
intent.putExtra("from act A", "Hello");
androidContext.startActivity(intent);

Now if Activity A is terminated and restarted, is there a way to
get a handler to Activity B again? If it calls the above statements
again and since the SINGLE_TASK flag is called I am expecting
that Activity B won't be regenerated which means if I change
the Extras then Activity B should receive the new data? But I am
not sure if that's possible unless a OnNewActivity method is called
that will force Activity B to read the new data. Is this correct? I am
not 100% clear as to how activities can communicate in a iterative
manner through the new intent method.

Thanks

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment