The code is down from [email protected], due to a bit of the basis of downloading someone else's code in a way to brush up. @Overridepublic void onclick (view v) {if (null != pop && Pop.isshowing ()) {// Hide window, if set to click outside the window hours that do not need this way to hide Pop.dismiss ();} else {// Popup Popupwindow specific code layoutinflater inflater = (layoutinflater) Getsystemservice (Layout_inflater_service); View view = inflater.inflate (r.layout.popup, null);// Create Popupwindow object pop = New popupwindow (View, 500, 700, false);// need to set this parameter, click outside to disappear// Set Click Window outside window disappears pop.setoutsidetouchable (false);// set this parameter to get focus, otherwise you cannot click webview = (WebView) View.findviewbyid (R.id.webview1); Webview.requestfocusfromtouch (); Webview.setwebviewclient (new Webviewclient () {@Overridepublic void onpagefinished (Webview view, string url) {if (Null != progressdialog) {pop.update (150, 0, 800, 1000);p roGressdialog.dismiss ();};}); / set the WebView property to be able to execute JavaScript script webview.getsettings (). Setjavascriptenabled (True);// Load the page webview.loadurl ("http://www.baidu.com/") that needs to be displayed;p rogressdialog = progressdialog.show ( View.getcontext (),null, "page load, please later:"); Progressdialog.setcanceledontouchoutside (True);//pop.showasdropdown (v);p op.showatlocation (Mine.getWindow (). Getdecorview (), gravity.no_gravity , 0, 0);}}
4-point knowledge needs to be recorded
1, Layoutinflater
Custom View
2, Popupwindow
Pop-up box port:
3, ProgressDialog
Progress bar
4,WebView
Web View
A section of Android jump to web interface code