Skip to content Skip to sidebar Skip to footer

Strange Bug / Behaviours With Viewpager And Actionbar (sherlock)

The following bug will happen on an 2.3 device, my setup works fine on 4.x devices. I have a ViewPager with some Fragments in it (they're all of the same class). Every Fragment i

Solution 1:

The problem is that the MotionEvent does not handled correctly by internal class ActionMenuItemView (actually, there is no any specific behavior in this class).

So, I do not resolve initial problem, but I find workaround solution. I just override ActionMenuItemView.dispatchTouchEvent() and handle click and long-click manually using GestureDetector.

You can check this solution on github.

Solution 2:

I don't know this exact problem, but I had a problem when flipping the device. The app was crashing. Finally, I've found that was problem of the Pager classes, because I was implementing them like you've implemented your SectionsPagerAdapter class.

I put the public classes that were on the main class on separated classes and the layouts worked well in vertical and horizontal position.

I don't know if this could be the problem, but you could try to create the corresponding classes instead of leaving them on the main class. Anyway, you pass to the SectionsPagerAdapter the FragmentManager, so you will not have any extra problem putting the public classes in their respective files.

Good luck!

Post a Comment for "Strange Bug / Behaviours With Viewpager And Actionbar (sherlock)"