It works. The exact code is:
public void onTabChanged(String tabId) {
if(TAG_B.equals(tabId)) {
MyBActivity bActivity = (MyBActivity
)getLocalActivityManager().getActivity(tabId);
bActivity.refreshFromDB();
}
}
However it is a bit strange that onResume is not called. It would be a much
nicer solution.
Thierry.
2010/6/13 Thierry Legras
> Maybe I have found something:
>
> From TabActivity, set a OnTabChangedListener,
> then the listener is called:
>
> String tabTag = getTabHost().getCurrentTabTag();
> if tabTag.isEqual(TAB_B) {
> MyBActivity bActivity = (MyBActivity
> )getLocalActivityManager().getActivity(tabTag);
> bActivity->refreshFromDB(); //
> }
>
> I will try that.
>
> Thierry.
>
>
> 2010/6/13 Thierry Legras
>
> Hi,
>>
>> I have a TabActivity with 3 tabs:
>> - tab A is created with a TabContentFactory,
>> - tabs B & C are created as Activity.
>>
>> When I switch from B to C, B activity is resumed (onResume called). But
>> when i switch from A to B, onResume is NOT called.
>> Unfortunately i need B to be aware that it has been selected. How can B
>> activity knows that i has just been selected?
>>
>> Any clue?
>> Thanks for any help.
>> --
>> Thierry.
>>
>
>
>
> --
> Thierry.
>
--
Thierry.
--
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