mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-16 05:39:24 +00:00
fix(android): Catch KMPBrowserActivity WebView exception
This commit is contained in:
parent
d4f96d66b7
commit
b608ca3f17
1 changed files with 8 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ import android.graphics.Bitmap;
|
|||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.AndroidRuntimeException;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
|
@ -70,7 +71,13 @@ public class KMPBrowserActivity extends BaseActivity {
|
|||
}
|
||||
}
|
||||
|
||||
setContentView(R.layout.activity_kmp_browser);
|
||||
try {
|
||||
setContentView(R.layout.activity_kmp_browser);
|
||||
} catch (AndroidRuntimeException e) {
|
||||
// WebView not enabled
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
webView = (WebView) findViewById(R.id.kmpBrowserWebView);
|
||||
webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue