android.webkit.RenderProcessGoneDetail Java Examples

The following examples show how to use android.webkit.RenderProcessGoneDetail. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebPlayerView.java    From unity-ads-android with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onRenderProcessGone(final android.webkit.WebView view, RenderProcessGoneDetail detail) {

	Utilities.runOnUiThread(new Runnable() {
		@Override
		public void run() {
			// need to clean up the WebView because it's rendering process crashed or ran out of memory
			// We probably don't want to try to re-create the WebView because there may not be enough memory to do so.
			ViewUtilities.removeViewFromParent(view);
			view.destroy();
		}
	});

	WebPlayerEventBridge.error(viewId, getUrl(), "UnityAds Sdk WebPlayer onRenderProcessGone : " + detail.toString());

	// the ads sdk cannot be recovered but return true to prevent the crash
	DeviceLog.error("UnityAds Sdk WebPlayer onRenderProcessGone : " + detail.toString());

	return true;
}
 
Example #2
Source File: WebViewApp.java    From unity-ads-android with Apache License 2.0 6 votes vote down vote up
@Override
public boolean onRenderProcessGone(android.webkit.WebView view, RenderProcessGoneDetail detail) {
	Utilities.runOnUiThread(new Runnable() {
		@Override
		public void run() {
			// We need to shut down current Ad Unit Activity in case we are showing an ad
			if (AdUnit.getAdUnitActivity() != null) {
				AdUnit.getAdUnitActivity().finish();
			}

			// Since WebViewHandler won't able to delete WebView due to race condition we do it here.
			// Still it is questionable if we need to do it. Since Ad Unit activity will be destroyed anyway.
			if (WebViewApp.getCurrentApp() != null && WebViewApp.getCurrentApp().getWebView() != null) {
				ViewUtilities.removeViewFromParent(WebViewApp.getCurrentApp().getWebView());
			}

			// Launch reset process
			InitializeThread.reset();
		}
	});

	// the ads sdk cannot be recovered but return true to prevent the crash
	DeviceLog.error("UnityAds Sdk WebView onRenderProcessGone : " + detail.toString());

	return true;
}
 
Example #3
Source File: InnerFastClient.java    From FastWebView with MIT License 5 votes vote down vote up
@RequiresApi(api = Build.VERSION_CODES.O)
@Override
public boolean onRenderProcessGone(WebView view, RenderProcessGoneDetail detail) {
    if (mDelegate != null) {
        return mDelegate.onRenderProcessGone(view, detail);
    }
    return super.onRenderProcessGone(view, detail);
}