From 34fdc7c2d6030feb00852692cde271fd6537d884 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 19 Jul 2020 08:31:47 +0200 Subject: [PATCH] Lots of bugs in Android --- .../java/eu/faircode/email/FixedTextView.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FixedTextView.java b/app/src/main/java/eu/faircode/email/FixedTextView.java index 3b567da516..2dde11fdad 100644 --- a/app/src/main/java/eu/faircode/email/FixedTextView.java +++ b/app/src/main/java/eu/faircode/email/FixedTextView.java @@ -203,4 +203,32 @@ public class FixedTextView extends AppCompatTextView { return false; } } + + @Override + public void setText(CharSequence text, BufferType type) { + try { + super.setText(text, type); + } catch (Throwable ex) { + Log.w(ex); + /* + java.lang.IndexOutOfBoundsException: + at android.text.PackedIntVector.getValue (PackedIntVector.java:71) + at android.text.DynamicLayout.getLineTop (DynamicLayout.java:602) + at android.text.Layout.getLineBottom (Layout.java:1260) + at android.widget.TextView.invalidateRegion (TextView.java:5379) + at android.widget.TextView.invalidateCursor (TextView.java:5348) + at android.widget.TextView.spanChange (TextView.java:8351) + at android.widget.TextView$ChangeWatcher.onSpanAdded (TextView.java:10550) + at android.text.SpannableStringInternal.sendSpanAdded (SpannableStringInternal.java:315) + at android.text.SpannableStringInternal.setSpan (SpannableStringInternal.java:138) + at android.text.SpannableString.setSpan (SpannableString.java:46) + at android.text.Selection.setSelection (Selection.java:76) + at android.text.Selection.setSelection (Selection.java:87) + at android.text.method.ArrowKeyMovementMethod.initialize (ArrowKeyMovementMethod.java:336) + at android.widget.TextView.setText (TextView.java:4555) + at android.widget.TextView.setText (TextView.java:4424) + at android.widget.TextView.setText (TextView.java:4379) + */ + } + } }