Additional testing notes available in #1364
This commit is contained in:
julianharty 2019-08-14 12:41:20 +01:00
parent cf7e392c85
commit 37d3f43c29
2 changed files with 15 additions and 9 deletions

View File

@ -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) {

View File

@ -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 {