Workaround yet another Android crash

This commit is contained in:
M66B 2020-07-19 10:56:49 +02:00
parent a1c5427e10
commit 0ff5ccc5dd
1 changed files with 18 additions and 0 deletions

View File

@ -20,6 +20,7 @@ package eu.faircode.email;
*/ */
import android.content.Context; import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.MotionEvent; import android.view.MotionEvent;
@ -69,6 +70,23 @@ public class FixedEditText extends AppCompatEditText {
} }
} }
@Override
protected void onDraw(Canvas canvas) {
try {
super.onDraw(canvas);
} catch (Throwable ex) {
Log.w(ex);
/*
java.lang.ArrayIndexOutOfBoundsException: length=39; index=-3
at android.text.DynamicLayout.getBlockIndex(DynamicLayout.java:648)
at android.widget.Editor.drawHardwareAccelerated(Editor.java:1703)
at android.widget.Editor.onDraw(Editor.java:1672)
at android.widget.TextView.onDraw(TextView.java:6914)
at android.view.View.draw(View.java:19200)
*/
}
}
@Override @Override
public boolean onTouchEvent(MotionEvent event) { public boolean onTouchEvent(MotionEvent event) {
try { try {