Lucky Luke
Lucky Luke

Reputation: 147

changing ActionBarSherlock tab contents

I have created a 3-tabbed layout using ActionBarSherlock library, 2 of which containing maps. I have also added some annotations on the maps. From now on I will refer to the one of the two tabs containing maps but the same will apply for the other one, too.

What I want to do is to "refresh" the contents of the map. This will be done when clicking on an annotation that ideally will open a list fragment containing details about it and that will replace the map fragment entirely.

  1. So, I want to do this "switching" between map and list fragment but I can't because the only way I found in order for the tabs to change content is by registering the ActionBar.TabListener. http://developer.android.com/reference/android/app/ActionBar.TabListener.html Moreover, this is not a solution because there is no tab event fired in this case, as far as I am concerned.

  2. Now I'm building the tabs and their contents programmatically. Would it be easier to create it with xml files in order to have direct access to the tabs? Now, I don't have a "pointer" to the tab objects. If so, any guidelines about this? I' m referring to the tabs, not the action bar menu.

Thanks in advance, for any suggestion.

Upvotes: 0

Views: 208

Answers (1)

ASP
ASP

Reputation: 3705

As much as i understand your question, I think you should make use of SharedPreferences to pass on the values from one fragment to another while on tabclick...http://developer.android.com/reference/android/content/SharedPreferences.html

Upvotes: 0

Related Questions