Prevent crash

This commit is contained in:
M66B 2020-01-04 16:46:06 +01:00
parent eded20caae
commit e21e34800a
1 changed files with 14 additions and 2 deletions

View File

@ -83,7 +83,19 @@ public class DrawerLayoutEx extends DrawerLayout {
if (!rect.contains((int) ev.getX(), (int) ev.getY()))
return false;
}
return super.onInterceptTouchEvent(ev);
try {
return super.onInterceptTouchEvent(ev);
} catch (Throwable ex) {
Log.w(ex);
/*
java.lang.NullPointerException: Attempt to get length of null array
java.lang.NullPointerException: Attempt to get length of null array
at androidx.customview.widget.ViewDragHelper.checkTouchSlop(SourceFile:1334)
at androidx.drawerlayout.widget.DrawerLayout.onInterceptTouchEvent(SourceFile:1512)
*/
return false;
}
}
@Override
@ -97,7 +109,7 @@ public class DrawerLayoutEx extends DrawerLayout {
if (rect.contains((int) ev.getX(), (int) ev.getY()))
return content.dispatchGenericMotionEvent(ev);
}
return super.dispatchGenericMotionEvent(ev);
}
}