class MoPubActivity extends BaseInterstitialActivity {

    static void preRenderHtml(final Context context, final CustomEventInterstitialListener customEventInterstitialListener, String htmlData) {
        HtmlInterstitialWebView dummyWebView = HtmlInterstitialWebViewFactory.create(context, customEventInterstitialListener, false, null, null, null);
        dummyWebView.enablePlugins(false);

        dummyWebView.addMoPubUriJavascriptInterface(new HtmlInterstitialWebView.MoPubUriJavascriptFireFinishLoadListener() {
            @Override
            public void onInterstitialLoaded() {
                customEventInterstitialListener.onInterstitialLoaded();
            }
        });
        dummyWebView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                if (url.equals(MOPUB_FINISH_LOAD)) {
                    customEventInterstitialListener.onInterstitialLoaded();
                } else if (url.equals(MOPUB_FAIL_LOAD)) {
                    customEventInterstitialListener.onInterstitialFailed(null);
                }

                return true;
            }
        });
        dummyWebView.loadHtmlResponse(htmlData);
    }

}