使用は、私がprogressDialog示されている....すべてのソースコードやこれを行うためのプログラム例で私を助けてください
web = (WebView)v.findViewById(R.id.web);
WebSettings settings = web.getSettings();
settings.setJavaScriptEnabled(true);
web.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
final AlertDialog alertDialog = new AlertDialog.Builder(getActivity()).create();
progressBar = ProgressDialog.show(getActivity(), getString(R.string.app_name), "Loading...");
web.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
public void onPageFinished(WebView view, String url) {
if (progressBar.isShowing()) {
progressBar.dismiss();
}
}
@SuppressWarnings("deprecation")
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Toast.makeText(getActivity(), "Oh no! " + description, Toast.LENGTH_SHORT).show();
alertDialog.setTitle("Error");
alertDialog.setMessage(description);
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(final DialogInterface dialog, final int which) {
return;
}
});
alertDialog.show();
}
});
web.loadUrl("https://www.facebook.com/Schapp-Demo-451986454993905/");