本文整理汇总了Java中com.tencent.smtt.sdk.WebSettings.setPluginState方法的典型用法代码示例。如果您正苦于以下问题:Java WebSettings.setPluginState方法的具体用法?Java WebSettings.setPluginState怎么用?Java WebSettings.setPluginState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tencent.smtt.sdk.WebSettings
的用法示例。
在下文中一共展示了WebSettings.setPluginState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initWebViewSettings
import com.tencent.smtt.sdk.WebSettings; //导入方法依赖的package包/类
private void initWebViewSettings() {
WebSettings webSetting = this.getSettings();
webSetting.setJavaScriptEnabled(true);
webSetting.setJavaScriptCanOpenWindowsAutomatically(true);
webSetting.setAllowFileAccess(true);
webSetting.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);
webSetting.setSupportZoom(true);
webSetting.setBuiltInZoomControls(true);
webSetting.setUseWideViewPort(true);
webSetting.setSupportMultipleWindows(true);
// webSetting.setLoadWithOverviewMode(true);
webSetting.setAppCacheEnabled(true);
// webSetting.setDatabaseEnabled(true);
webSetting.setDomStorageEnabled(true);
webSetting.setGeolocationEnabled(true);
webSetting.setAppCacheMaxSize(Long.MAX_VALUE);
// webSetting.setPageCacheCapacity(IX5WebSettings.DEFAULT_CACHE_CAPACITY);
webSetting.setPluginState(WebSettings.PluginState.ON_DEMAND);
// webSetting.setRenderPriority(WebSettings.RenderPriority.HIGH);
webSetting.setCacheMode(WebSettings.LOAD_NO_CACHE);
}
示例2: initWebViewSetting
import com.tencent.smtt.sdk.WebSettings; //导入方法依赖的package包/类
/**
* 初始化WebView的setting事件
*/
private void initWebViewSetting() {
WebSettings webSetting = mWebView.getSettings();
webSetting.setAllowFileAccess(true);
webSetting.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
webSetting.setSupportZoom(true);
webSetting.setBuiltInZoomControls(true);
webSetting.setUseWideViewPort(true);
webSetting.setSupportMultipleWindows(false);
// webSetting.setLoadWithOverviewMode(true);
webSetting.setAppCacheEnabled(true);
// webSetting.setDatabaseEnabled(true);
webSetting.setDomStorageEnabled(true);
webSetting.setJavaScriptEnabled(true);
webSetting.setGeolocationEnabled(true);
webSetting.setAppCacheMaxSize(Long.MAX_VALUE);
webSetting.setAppCachePath(this.getDir("appcache", 0).getPath());
webSetting.setDatabasePath(this.getDir("databases", 0).getPath());
webSetting.setGeolocationDatabasePath(this.getDir("geolocation", 0)
.getPath());
// webSetting.setPageCacheCapacity(IX5WebSettings.DEFAULT_CACHE_CAPACITY);
webSetting.setPluginState(WebSettings.PluginState.ON_DEMAND);
CookieSyncManager.createInstance(this);
CookieSyncManager.getInstance().sync();
}
示例3: initWebViewSettings
import com.tencent.smtt.sdk.WebSettings; //导入方法依赖的package包/类
private void initWebViewSettings() {
WebSettings webSetting = this.getSettings();
webSetting.setJavaScriptEnabled(true);
webSetting.setJavaScriptCanOpenWindowsAutomatically(true);
webSetting.setAllowFileAccess(true);
webSetting.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);
webSetting.setSupportZoom(true);
webSetting.setBuiltInZoomControls(true);
webSetting.setUseWideViewPort(true);
webSetting.setSupportMultipleWindows(true);
webSetting.setAppCacheEnabled(true);
webSetting.setDomStorageEnabled(true);
webSetting.setGeolocationEnabled(true);
webSetting.setAppCacheMaxSize(Long.MAX_VALUE);
webSetting.setPluginState(WebSettings.PluginState.ON_DEMAND);
webSetting.setCacheMode(WebSettings.LOAD_NO_CACHE);
}
示例4: initWebViewSetting
import com.tencent.smtt.sdk.WebSettings; //导入方法依赖的package包/类
/**
* init WebView
*/
private void initWebViewSetting() {
WebSettings webSetting = mWebView.getSettings();
webSetting.setAllowFileAccess(true);
webSetting.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);
webSetting.setSupportZoom(true);
webSetting.setBuiltInZoomControls(true);
webSetting.setUseWideViewPort(true);
webSetting.setSupportMultipleWindows(false);
webSetting.setAppCacheEnabled(true);
webSetting.setDomStorageEnabled(true);
webSetting.setJavaScriptEnabled(true);
webSetting.setGeolocationEnabled(true);
webSetting.setAppCacheMaxSize(Long.MAX_VALUE);
webSetting.setAppCachePath(this.getDir("appcache", 0).getPath());
webSetting.setDatabasePath(this.getDir("databases", 0).getPath());
webSetting.setGeolocationDatabasePath(this.getDir("geolocation", 0)
.getPath());
webSetting.setPluginState(WebSettings.PluginState.ON_DEMAND);
long time = System.currentTimeMillis();
if (mIntentUrl == null) {
mWebView.loadUrl(mHomeUrl);
} else {
mWebView.loadUrl(mIntentUrl.toString());
}
// print the time of webView load
TbsLog.d("time-cost", "cost time: " + (System.currentTimeMillis() - time));
// manage Cookie
CookieSyncManager.createInstance(this);
CookieSyncManager.getInstance().sync();
}