tags:

views:

10

answers:

1

My app has a TabHost with 3 tabs (checked, unchecked, all). Each of the tabs has a function called fillData() which loops through database records populating a ScrollView. If a user clicks a checkbox on one tab the record will move to the next tab (changing it from checked to unchecked, or vice versa). As it's designed right now the record is being removed from the current tab, because I'm recalling fillData() after the update is made. The tab it has been moved to has not been updated.

I am calling fillData from the onCreate method, which works for the initial load, but when a user returns to a previously created tab onCreate doesn't seem to be called. What method is called each time the page loads? I assume that is where I should call fillData(), right?

Thank you for your help.

A: 

The answer is onStart and onResume. If I just used onStart, when I move between tabs it does not refresh the list. When I put fillData in the onStart and onResume it executes each time the tab is loaded.

alockrem