mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-05 12:24:26 +01:00
Handle WebView inflate exceptions
Like: android.view.InflateException: Binary XML file line #17: Error inflating class android.webkit.WebView Caused by: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to find donor package: com.android.chrome
This commit is contained in:
@@ -28,6 +28,7 @@ import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Base64;
|
||||
import android.view.ContextMenu;
|
||||
import android.view.InflateException;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@@ -64,7 +65,15 @@ public class FragmentWebView extends FragmentBase {
|
||||
@Override
|
||||
@Nullable
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_webview, container, false);
|
||||
View view = null;
|
||||
try {
|
||||
view = inflater.inflate(R.layout.fragment_webview, container, false);
|
||||
} catch (InflateException ex) {
|
||||
Toast.makeText(getContext(),
|
||||
getString(R.string.title_no_viewer, Helper.formatThrowable(ex)),
|
||||
Toast.LENGTH_LONG).show();
|
||||
return null;
|
||||
}
|
||||
|
||||
progressBar = view.findViewById(R.id.progressbar);
|
||||
webview = view.findViewById(R.id.webview);
|
||||
|
||||
Reference in New Issue
Block a user