Skip to content

Commit b9fcbc0

Browse files
committed
Update SlideHolder.java
I'm not sure if this is the best thing to do, but at least my apps are not crashing anymore. The scenario is: With the menu opened, try to close and while the menu is closing quickly touch one item of the menu.
1 parent 7b73c7f commit b9fcbc0

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

src/com/agimind/widget/SlideHolder.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,19 @@ public boolean dispatchTouchEvent(MotionEvent ev) {
481481

482482
return true;
483483
} else {
484-
onTouchEvent(ev);
485-
486-
ev.offsetLocation(-menu.getLeft(), -menu.getTop());
487-
menu.dispatchTouchEvent(ev);
488-
489-
return true;
484+
try {
485+
onTouchEvent(ev);
486+
487+
ev.offsetLocation(-menu.getLeft(), -menu.getTop());
488+
menu.dispatchTouchEvent(ev);
489+
490+
return true;
491+
} catch (IllegalArgumentException e) {
492+
/*
493+
* Possibility of crashes on some devices (especially on Samsung).
494+
*/
495+
return super.dispatchTouchEvent(ev);
496+
}
490497
}
491498
}
492499
}

0 commit comments

Comments
 (0)