开发者

Signal TabHost to reload view

开发者 https://www.devze.com 2023-02-12 16:45 出处:网络
I have a view that\'s contained inside a TabHost\'s FrameLayout. How can I programmatically开发者_C百科 tell the TabHost to reload the same view that\'s requesting it ? Something like \"reset\" in htm

I have a view that's contained inside a TabHost's FrameLayout. How can I programmatically开发者_C百科 tell the TabHost to reload the same view that's requesting it ? Something like "reset" in html.

Thanks


You can access your Tab by using LocalActivityManager and and you can access this via getLocalActivityManager().

In LocalActivityManager there are two methods available namely destroyActivity() and startActivity()..

LocalActivityManager localActivityManager = getLocalActivityManager();
localActivityManager .destroyActivity("tabid", true);
localActivityManager .startActivity("tabid", new Intent(this, YourTab.class));

Here tabid is the String which has been used in TabHost.newTabSpec(tabid)).

0

精彩评论

暂无评论...
验证码 换一张
取 消