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

View file

@ -31,6 +31,7 @@ import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Parcel;
@ -496,6 +497,11 @@ public final class ComposeActivity
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.
contentWarningEditor.addTextChangedListener(new TextWatcher() {
@Override