I have a TabHost with some TabSpecs (Activities). In my TabActivity I have a thread that is updating some values each 10 seconds and I'd like to pass these values to my currently shown Activity, and this Activity will execute a function each time this values get updated.
What the better way to do it? Implement a timer in the TabSpec Activity(visible activity), so in a period of time(using a timer) I get the values, or a listener that starts an event that warn the TabSpec(visible activity) the changes? Or there is another way?
Explaining what I want:
TabHost (TabActivity) => vars v1, v2, v3 updated by downloading some information from web.
Tabs: Tab1, Tab2, Tab3.
CurrentTab: Tab1, displays v1, v2 and v3(updating these values), and also executes a function when these values are updated
If I change the current tab to Tab2: Tab2, displays v1, v2 and v3(updating these values), and also executes a function when these values are updated
Thanks for help.