当我从活动回来时刷新选项卡
我有一个 Main TabActivity,上面有 5 个选项卡。每个选项卡都包含一个 Asyntask,它检索数据并显示在 ListView 上。 在此主要活动的顶部,我有一个用于签入的按钮。当我按下按钮时,选项卡的内容会发生变化,因此我想在从 Chekin Activity 回来后更新列表视图。 但是当我回到主活动时,我不知道如何更新内部选项卡,即调用其 AsyncTask 并更新当前选项卡的 Listview。
I have a Main TabActivity with 5 tabs on it. Each tabs consists of an Asyntask which retrieves data and shows on a ListView.
On the top on this Main activity I have a button to do checkin. When I press the button, the content of the tabs change, so I would like to update the Listviews once I am back from the Chekin Activity.
But when I am back to the Main activity I dont know how to update the tabs inside, that is call to their AsyncTask and update the Listview of the current tab.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决了将侦听器设置为分配给选项卡小部件的活动中的主活动中的按钮的问题。因此,当按钮的活动完成对列表视图的 ActivityOnResult 的更新时,再次调用获取数据的 AsyncTask。
I solved the problem setting the listener to the button in the Main activity in the Activity assigned to the tabwidget. Therefore when the activity of the button finish update on the ActivityOnResult the listview, calling again the AsyncTask which gets data.