|
|
@ -111,16 +111,20 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onPageCommitVisible(WebView view, String url) {
|
|
|
|
public void onPageCommitVisible(WebView view, String url) {
|
|
|
|
Log.i("Commit url=" + url);
|
|
|
|
Log.i("Commit url=" + url + " runnable=" + (onPageLoaded != null));
|
|
|
|
if (onPageLoaded != null)
|
|
|
|
if (onPageLoaded != null) {
|
|
|
|
ApplicationEx.getMainHandler().post(onPageLoaded);
|
|
|
|
ApplicationEx.getMainHandler().post(onPageLoaded);
|
|
|
|
|
|
|
|
onPageLoaded = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean onRenderProcessGone(WebView view, RenderProcessGoneDetail detail) {
|
|
|
|
public boolean onRenderProcessGone(WebView view, RenderProcessGoneDetail detail) {
|
|
|
|
Log.i("Render process gone");
|
|
|
|
Log.e("Render process gone");
|
|
|
|
if (onPageLoaded != null)
|
|
|
|
if (onPageLoaded != null) {
|
|
|
|
ApplicationEx.getMainHandler().post(onPageLoaded);
|
|
|
|
ApplicationEx.getMainHandler().post(onPageLoaded);
|
|
|
|
|
|
|
|
onPageLoaded = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
return super.onRenderProcessGone(view, detail);
|
|
|
|
return super.onRenderProcessGone(view, detail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -147,7 +151,23 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void setOnPageLoaded(Runnable runnable) {
|
|
|
|
void setOnPageLoaded(Runnable runnable) {
|
|
|
|
|
|
|
|
Log.i("Set on page finished");
|
|
|
|
onPageLoaded = runnable;
|
|
|
|
onPageLoaded = runnable;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ApplicationEx.getMainHandler().postDelayed(new Runnable() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (onPageLoaded != null) {
|
|
|
|
|
|
|
|
Log.e("Page loaded fallback");
|
|
|
|
|
|
|
|
onPageLoaded.run();
|
|
|
|
|
|
|
|
onPageLoaded = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
|
|
|
Log.e(ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, 2500L);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void setImages(boolean show_images, boolean inline) {
|
|
|
|
void setImages(boolean show_images, boolean inline) {
|
|
|
|