Question

I have a Tabbed Activity, which contains three tabs, which are initialized as follows:

TabHost tabHost = getTabHost();

TabSpec porabaspec = tabHost.newTabSpec("Tab1");
porabaspec.setIndicator("Tab 1", getResources().getDrawable(R.drawable.icon_tab1));
porabaIntent = new Intent(this, PorabaActivity.class);
porabaspec.setContent(porabaIntent);

...

tabHost.addTab(porabaspec); 
...

This Tabbed activity has a button event that calls an Async Task which executes a second activity that returns some data back to the Tabbed Activity. At this point I would like to update the Tab 1 Activity (porabaIntent) with this new data that I received.

How do I do this? If I pass the bundled data when I initialize the tabs, the data won't update when it's changed, however if I try and send it in the onPostExecute() method of the Async Task I cannot seem to bind it to porabaIntent.

Was it helpful?

Solution

I found that the solution to this problem is to use static variables in the main tabbed activity, which can be accessed and modified by its child tabbed activites.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top