mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-22 12:03:09 -04:00
Applied changes suggested in https://github.com/kiwix/kiwix-android/pull/1365
Additional testing notes available in #1364
This commit is contained in:
parent
cf7e392c85
commit
37d3f43c29
@ -92,15 +92,19 @@ public class KiwixWebViewClient extends WebViewClient {
|
||||
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
if (BuildConfig.IS_CUSTOM_APP && url.equals("content://" + BuildConfig.APPLICATION_ID + ".zim.base/null")) {
|
||||
Log.e(TAG_KIWIX, "Abandoning WebView as there's a problem getting the content for this custom app.");
|
||||
return;
|
||||
}
|
||||
if ((url.equals("content://" + BuildConfig.APPLICATION_ID + ".zim.base/null"))
|
||||
&& !BuildConfig.IS_CUSTOM_APP) {
|
||||
inflateHomeView(view);
|
||||
return;
|
||||
boolean invalidUrl = url.equals("content://" + BuildConfig.APPLICATION_ID + ".zim.base/null");
|
||||
Log.d(TAG_KIWIX, "invalidUrl = " + invalidUrl);
|
||||
|
||||
if (invalidUrl) {
|
||||
if (BuildConfig.IS_CUSTOM_APP) {
|
||||
Log.e(TAG_KIWIX, "Abandoning WebView as there's a problem getting the content for this custom app.");
|
||||
return;
|
||||
} else {
|
||||
inflateHomeView(view);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!url.equals("file:///android_asset/home.html")) {
|
||||
view.removeView(home);
|
||||
} else if (!BuildConfig.IS_CUSTOM_APP) {
|
||||
|
@ -369,7 +369,9 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
} else {
|
||||
Log.e(TAG_KIWIX, "Problem finding the content, no more OnCreate() code");
|
||||
// What should we do here? exit? I'll investigate empirically.
|
||||
return;
|
||||
// It seems unpredictable behaviour if the code returns at this point as yesterday
|
||||
// it didn't crash yet today the app crashes because it tries to load books
|
||||
// in onResume();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user