开发者

refresh a tab when I am back from an activity

开发者 https://www.devze.com 2023-03-23 22:38 出处:网络
I have a Main TabActivity with 5 tabs on it. Each tabs consists of an Asyntask which retrieves data and shows on a 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 activi开发者_StackOverflow中文版ty 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.


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.

0

精彩评论

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

关注公众号