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 @Override
public void onPageFinished(WebView view, String url) { public void onPageFinished(WebView view, String url) {
if (BuildConfig.IS_CUSTOM_APP && url.equals("content://" + BuildConfig.APPLICATION_ID + ".zim.base/null")) { boolean invalidUrl = 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."); Log.d(TAG_KIWIX, "invalidUrl = " + invalidUrl);
return;
} if (invalidUrl) {
if ((url.equals("content://" + BuildConfig.APPLICATION_ID + ".zim.base/null")) if (BuildConfig.IS_CUSTOM_APP) {
&& !BuildConfig.IS_CUSTOM_APP) { Log.e(TAG_KIWIX, "Abandoning WebView as there's a problem getting the content for this custom app.");
inflateHomeView(view); return;
return; } else {
inflateHomeView(view);
return;
}
} }
if (!url.equals("file:///android_asset/home.html")) { if (!url.equals("file:///android_asset/home.html")) {
view.removeView(home); view.removeView(home);
} else if (!BuildConfig.IS_CUSTOM_APP) { } else if (!BuildConfig.IS_CUSTOM_APP) {

View File

@ -369,7 +369,9 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
} else { } else {
Log.e(TAG_KIWIX, "Problem finding the content, no more OnCreate() code"); Log.e(TAG_KIWIX, "Problem finding the content, no more OnCreate() code");
// What should we do here? exit? I'll investigate empirically. // 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 { } else {