private void getData() {url = getIntent().getStringExtra(\"url\");//设置支持javaScriptwebSettings = webview.getSettings();//设置支持javaScriptwebSettings.setJavaScriptEnabled(true);//设置算计变大变小webSettings.setUseWideViewPort(true);//设置缩放按钮webSettings.setBuiltInZoomControls(true);//不让从当前网页跳转到系统的浏览器中webview.setWebViewClient(new WebViewClient(){//单加载页面完成时调用@Overridepublic void onPageFinished(WebView view, String url) {super.onPageFinished(view, url);pdLoading.setVisibility(View.GONE);}});webview.loadUrl(url);}
private void getData() {url = getIntent().getStringExtra(\"url\");//设置支持javaScriptwebSettings = webview.getSettings();//设置支持javaScriptwebSettings.setJavaScriptEnabled(true);//设置算计变大变小webSettings.setUseWideViewPort(true);//设置缩放按钮webSettings.setBuiltInZoomControls(true);//不让从当前网页跳转到系统的浏览器中webview.setWebViewClient(new WebViewClient(){//单加载页面完成时调用@Overridepublic void onPageFinished(WebView view, String url) {super.onPageFinished(view, url);pdLoading.setVisibility(View.GONE);}});webview.loadUrl(url);}private void showChangeTextSizeDialog() {//设置DialogAlertDialog.Builder builder = new AlertDialog.Builder(this);builder.setTitle(\"设置文字大小\");String[] items = {\"超大字体\",\"大字体\",\"正常字体\",\"小字体\",\"超小字体\"};builder.setSingleChoiceItems(items,realSize,new DialogInterface.OnClickListener(){@Overridepublic void onClick(DialogInterface dialog, int which) {tempSize = which;}});builder.setNegativeButton(\"取消\",null);builder.setPositiveButton(\"确定\", new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialog, int which) {realSize = tempSize;changeTextSize(realSize);}});builder.show();}
private void changeTextSize(int realSize) {switch (realSize){case 0://超大字体webSettings.setTextZoom(200);break;case 1://大字体webSettings.setTextZoom(150);break;case 2://正常字体webSettings.setTextZoom(100);break;case 3://小字体webSettings.setTextZoom(75);break;case 4://超小字体webSettings.setTextZoom(50);break;}}