I have 2 tabs with tagID “tag01” and “tag02”. I have explicitly set
the focus to first tab by calling tabHost.setCurrentTab(0)
When i call getLocalActivityManager().getActivity("tag01") i get the
object of activity but when i call
getLocalActivityManager().getActivity("tag02") then i get NULL.
//Log.i("tab status: ", getLocalActivityManager().getActivity("tag02")+""); prints null
//Log.i("tab status: ", getLocalActivityManager().getActivity("tag01")+""); prints com.test.TestActivity@437c06c8
Now when i again run my app and this time click second tab and then
getLocalActivityManager().getActivity("tag02") gives object
(toString() in logcat).
So after checking it again and again i found that “only activity in
first tab( that i had set focus explicitly by
tabHost.setCurrentTab(0)) returns non-null” and other tabs return null
unless u don’t click those tab.
When i click all tabs i.e atleast i go through all tabs by clicking
them then getLocalActivityManager().getActivity(anyTag) returns
object(i am tracing toString()) . How to access activity from other
tabs without clicking other tabs because user won’t know that he/she
has to click tabs.
Please give some suggestions. Because i have to access activity in
tabs in my app.
I hope you understood my problem.
thanks
The activity is not created!
if you have
ntabs You could do this in your onCreate():In this way, the tab displayed is the first tab (with index 0) and
getLocalActivityManager().getActivity(anyTag)will return non-null