Вопрос

I´m experiencing a weird problem with SlidingMenu Library and ViewPager when they are running on devices with Android 3.2 (Honeycomb).

The problem appears when we "toggle" the SlidingMenu to show the Menu that is hidden on the left of the app. When we do this, both ContentView and BehingContentView stops responding to touch events.

Thinking that this was a problem related to my application, I downloaded the last version of ABS and SlidingMenu library and configured a new project using the built-in example that comes with the SlidingMenu and, for my surprise, the same behavior occurred with the ViewPager example.

These are the steps that I did:

  1. Configure an Emulator using API Level 13 and 7" WSVGA (Tablet);
  2. Download ABS and SlidingMenu from GIT;
  3. Setup a new Project, using the compatibility library android-support-v41 (Also tested with android-support-v4);
  4. Solved the problem 'getSupportActionBar() is undefined' as described here: https://github.com/jfeinstein10/SlidingMenu/issues/145;
  5. Run the 'Example Application' and choose 'ViewPager' example;
  6. Swipe pages to the right and to the left, without opening the menu;
  7. Open the menu. See that the lists don´t scroll as expected;
  8. Close the menu. See that the viewpager doesn´t responds to touch events anymore;

Notice that this behavior was reported only on Android 3.2 devices. We have the same application running on 2.x and on 4.x devices, without this problem.

Also, noticed that the Example Application that was downloaded from Google Play doesn´t have this problem.

Does anybody have any advice? Thanks a lot!

Edit 1

Tested on a real device, and confirmed the Behavior. Does anybody have an advice?

Это было полезно?

Решение

I had the same problem and fixed it by using the following work-around.

Replace these lines in SlidingMenu.java:

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void manageLayers(float percentOpen) {
    if (Build.VERSION.SDK_INT < 11) return;

with:

@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public void manageLayers(float percentOpen) {
    if (Build.VERSION.SDK_INT < 14) return;
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top