简体   繁体   中英

Why Google Vignette Ads not showing in Android WebView (Java)?

In the app there is a webview which views a webpage which has a vignette ad, but the ad is not shown in webview, its shown in other mediums, what may be the cause? is there any policy that's preventing it from appearing?

Found that adding these lines enabled Vignette in webpage

    webView.getSettings().setJavaScriptEnabled(true);
    //Zoom
    webView.getSettings().setBuiltInZoomControls(true);
    webView.getSettings().setDisplayZoomControls(false);
    //Cache and storage
    webView.getSettings().setAppCacheEnabled(true);
    webView.getSettings().setDatabaseEnabled(true);
    webView.getSettings().setDomStorageEnabled(true);
    webView.getSettings().setUseWideViewPort(true);
    webView.getSettings().setLoadWithOverviewMode(true);
    webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
    //optional settings
    webView.getSettings().setAppCachePath(getApplicationContext().getCacheDir().getAbsolutePath());
    webView.getSettings().setAllowFileAccess(true);
    webView.getSettings().setAppCacheEnabled(true);
    //Others
    webView.setFocusable(true);
    webView.setFocusableInTouchMode(true);
    webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
    webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);//the best for games

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM