本文整理了Java中android.webkit.WebView.setNetworkAvailable()
方法的一些代码示例,展示了WebView.setNetworkAvailable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.setNetworkAvailable()
方法的具体详情如下:
包路径:android.webkit.WebView
类名称:WebView
方法名:setNetworkAvailable
暂无
代码示例来源:origin: luili16/UIMocker
@Override
public void setNetworkAvailable(boolean networkUp) {
mWebView.setNetworkAvailable(networkUp);
}
代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-bluebill-mobile-android-taxonomy-factsheet
@Override @Nonnull
public void renderTo (final @Nonnull View view, final @Nonnull Object... extra)
{
final WebView webView = (WebView)view.findViewById(R.id.tvText);
webView.setNetworkAvailable(false);
webView.loadData(UriEncoder.uriEncoded(presentationModel.getText()), "text/html", "unicode-16");
// webView.loadData(URLEncoder.encode(node.getText(), "utf-8"), "text/html", "utf-8");
// webView.setText(Html.fromHtml(node.getText()));
}
}
代码示例来源:origin: it.tidalwave.bluebill/it-tidalwave-bluebill-mobile-android-news
public void populate (final @Nonnull PresentationModel newsItemPM)
{
try
{
final Document message = newsItemPM.as(Document.class);
final String date = preferences.get().formatDateAndTime((Date)message.get(PUB_DATE));
((TextView)findViewById(R.id.tvDate)).setText(date);
((TextView)findViewById(R.id.tvTitle)).setText(message.get(TITLE));
final String text = "<html><body>" + UriEncoder.uriEncoded(message.get(CONTENT)) + "</body></html>";
final WebView webView = (WebView)findViewById(R.id.wvContent);
webView.setNetworkAvailable(false);
webView.loadData(text, "text/html", "utf-8");
}
catch (NotFoundException e)
{
throw new RuntimeException(e);
}
}
}
代码示例来源:origin: fr.avianey/bolts-android-api
final WebView webView = new WebView(context);
webView.getSettings().setJavaScriptEnabled(true);
webView.setNetworkAvailable(false);
webView.setWebViewClient(new WebViewClient() {
private boolean loaded = false;
代码示例来源:origin: stackoverflow.com
webview.addJavascriptInterface(new MyJavaScriptInterface(), "Android");
isConnected=isNetworkAvailable();
webview.setNetworkAvailable(isConnected);
webview.setWebViewClient(new WebViewClient() {
代码示例来源:origin: martykan/webTube
public void setUpWebview() {
// To save login info
CookieHelper.acceptCookies(webView, true);
// Some settings
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(false);
webSettings.setAllowFileAccess(false);
webSettings.setDatabaseEnabled(true);
String cachePath = mApplicationContext
.getDir("cache", Context.MODE_PRIVATE).getPath();
webSettings.setAppCachePath(cachePath);
webSettings.setAllowFileAccess(true);
webSettings.setAppCacheEnabled(true);
webSettings.setDomStorageEnabled(true);
webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
webView.setHorizontalScrollBarEnabled(false);
webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
webView.setBackgroundColor(Color.WHITE);
webView.setScrollbarFadingEnabled(true);
webView.setNetworkAvailable(true);
}
内容来源于网络,如有侵权,请联系作者删除!