Prevent crash

This commit is contained in:
M66B 2020-03-08 14:37:34 +01:00
parent 24bb405fbd
commit 1c3357b79e
1 changed files with 23 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@ -78,6 +79,28 @@ public class FixedTextView extends AppCompatTextView {
}
}
@Override
public boolean onTouchEvent(MotionEvent event) {
try {
return super.onTouchEvent(event);
} catch (Throwable ex) {
Log.w(ex);
return false;
/*
java.lang.IllegalArgumentException
at com.android.internal.util.Preconditions.checkArgument(Preconditions.java:33)
at android.widget.SelectionActionModeHelper$TextClassificationHelper.init(SelectionActionModeHelper.java:640)
at android.widget.SelectionActionModeHelper.resetTextClassificationHelper(SelectionActionModeHelper.java:203)
at android.widget.SelectionActionModeHelper.invalidateActionModeAsync(SelectionActionModeHelper.java:104)
at android.widget.Editor.invalidateActionModeAsync(Editor.java:2028)
at android.widget.Editor.showFloatingToolbar(Editor.java:1419)
at android.widget.Editor.updateFloatingToolbarVisibility(Editor.java:1397)
at android.widget.Editor.onTouchEvent(Editor.java:1367)
at android.widget.TextView.onTouchEvent(TextView.java:9701)
*/
}
}
@Override
protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
try {