重新启动在一个TabActivity单个标签的活动?重新启动、标签、TabActivity

由网友(誘魊←抵挡)分享简介:我有一个TabActivity。每个标签指向一个子活动。这个伟大的工程。 I have a TabActivity. Each tab point to a sub activity. This works great. 有什么聪明的方法来刷新活动标签之一?我只是想'重启'的标签#3例如活动。不知道的好办法做到这一...

我有一个TabActivity。每个标签指向一个子活动。这个伟大的工程。

I have a TabActivity. Each tab point to a sub activity. This works great.

有什么聪明的方法来刷新活动标签之一?我只是想'重启'的标签#3例如活动。不知道的好办法做到这一点以外的其他刷新支持建设以活动本身,或清除所有选项卡并重新创建所有的人。

Is there any clever way to refresh one of the activity tabs? I just want to 'restart' the activity in tab #3 for example. Not sure of a good way to do this other than building in refresh support to the activity itself, or clearing ALL the tabs and recreating all of them.

谢谢

推荐答案

略多于动态的解决方案:

Slightly more dynamic solution:

LocalActivityManager manager = getLocalActivityManager();
String currentTag = tabHost.getCurrentTabTag();
Class<? extends Activity> currentClass = manager.getCurrentActivity().getClass();
manager.destroyActivity(currentTag, true);
manager.startActivity(currentTag, new Intent(this, currentClass));
阅读全文

相关推荐

最新文章