ActionBarSherlock icon indicating copy to clipboard operation
ActionBarSherlock copied to clipboard

removeAllTabs() triggers onTabUnselected(), but does not commit the fragment transaction.

Open suau opened this issue 11 years ago • 4 comments

(See title) Platform tested was android 4.1.2 and actionbarsherlock 4.2.0: I've setup a simple activity with 2 tabs and a TabListener, which adds/removes the fragments onTabSelected and onTabUnselected. switching between those two tabs works fine, the fragment associated with the unselected tab gets properly paused, stopped, destroyed etc. When using getSupportActionBar().removeAllTabs() however, the onTabUnselected gets called, i remove the fragment using the given fragment transaction (as before), but the transaction never gets committed.

semi-wild guess of mine: since ActionBarSherlock is using the native implementation when possible, but the SupportFragmentManager doesn't. ActionBarWrapper just calls the native removeAllTabs(), which uses the native Fragment Manager.

P.S. same scenario using the native actionbar instead works as expected.

suau avatar Apr 19 '13 11:04 suau

I have the same issue. The FragmentTransaction seems to be commited between each tab change, but not after the call of getSupportActionBar().removeAllTabs().

jeanmatthieud avatar May 14 '13 19:05 jeanmatthieud

After some investigations, it seems that the custom implementation of the ActionBar commits the fragment transaction, but not the native one.

jeanmatthieud avatar May 14 '13 20:05 jeanmatthieud

Have you found at least a workaround for this? I'm getting overlapping fragments all over the place because of this... :(

(Thanks!)

gonzalo-rodriguez avatar Jun 12 '13 11:06 gonzalo-rodriguez

I have replicated the issue with the 4.3.1

ElMassimo avatar Jul 24 '13 20:07 ElMassimo