I'm trying to do something very simple. I have 2 tabs, one showing information about the breed of a dog and the other is showing a list of reviews that people have written describing the breed. I would like to include the number of reviews that were written in the Tab as well so it would look like so:
Breed Info | Reviews(19)
The issue is that I need to download said review data first in order to see the number of reviews there is on the tab.
So what I thought of as a solution was to add the tab first in my BreedProfile.java (ShelockActivity)
ActionBar.Tab reviewTab= ab.newTab();
reviewTab.setText("Reviews");
mTabsAdapter.addTab(reviewTab, DogReviewFragment.class, null);
Then in my BreedProfileReviewFragment.java I would download the reviews then update the reviewTab text by doing so:
getActivity().getActionBar().getTabAt(1).setText("Reviews 10");
However, the above method does not exist according to the LogCat.
03-05 18:15:26.460: E/AndroidRuntime(1286): FATAL EXCEPTION: main
03-05 18:15:26.460: E/AndroidRuntime(1286): java.lang.NoSuchMethodError: android.support.v4.app.FragmentActivity.getActionBar
So my question is, is it possible to access the TAB from the FRAGMENT to change the TEXT property of the TAB after it is added? If it is, how can I achieve that?
NOTES:
I cannot download the reviews together with the breed information because the API's are separate.
The BreedProfile.java Originates from a list of Breeds in a ListActivity BreedList.java.