work around crash on Android 8 (#731)

This commit is contained in:
Konrad Pozniak 2018-07-26 23:31:20 +02:00 committed by GitHub
parent dbdc597207
commit 2a6f6c4092
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,7 @@ import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.os.Parcel; import android.os.Parcel;
@ -496,6 +497,11 @@ public final class ComposeActivity
textEditor.setSelection(textEditor.length()); textEditor.setSelection(textEditor.length());
} }
// work around Android platform bug -> https://issuetracker.google.com/issues/67102093
if(Build.VERSION.SDK_INT == Build.VERSION_CODES.O || Build.VERSION.SDK_INT == Build.VERSION_CODES.O_MR1 ) {
textEditor.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
// Initialise the content warning editor. // Initialise the content warning editor.
contentWarningEditor.addTextChangedListener(new TextWatcher() { contentWarningEditor.addTextChangedListener(new TextWatcher() {
@Override @Override