I am working with ActivityGroup and I want to open an sub activity of the ActivityGroup on selection of 开发者_如何学运维another tab. Please anyone let me know if it is possible or not?
example - I have tab1 and I open a subActivity(say activity "A") in the same tab using ActivityGroup and now when I click on tab2 I should open the same Activity "A" with all its contents.
Thanks in Advance.
I really, strongly urge you to stop using ActivityGroup. This has been deprecated.
The fragment support library provides a much better way to do these things. The 3.2 version includes an example showing how to use it with the tab widget. See the "Fragment Tabs" example and the TabActivity documentation.
These can be used down to Android 1.6.
(There are also lots of demos there for other things you can do with fragments.)
This is how I thing it can be done :
open the sub-activity just as normally you do, create certain static variable to hold data between two opened activities, be it static bundle or strings, when ever you perform some action on activity ex: type some thing in edit text, save the content in those static variables, in the onResume of the activity, put those data from variables in views........
See if it works........
Try this code,
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
if not found helpful then please provide me some more details about flow and if possible then put your (xml/java) code. so i can clearly understand the problem.
Let me know it's useful for you or not by comment ?
精彩评论