CopyCode The Code is as follows: Package com. weizhu. Lan. view;
Import com. weizhu. Lan. util. myprogressdialog;
Import Android. App. activity;
Import Android. App. alertdialog;
Import Android. content. context;
Import Android. content. intent;
Import android.net. connectivitymanager;
Import Android. OS. asynctask;
Import Android. OS. Bundle;
Import Android. OS. Handler;
Import Android. View. keyevent;
Import Android. View. window;
Import Android. WebKit. webchromeclient;
Import Android. WebKit. webview;
Import Android. widget. progressbar;
Public class helpcenter extends activity {
// 50766649
Private string urlhelp = "http://www.jb51.net ",
Userid = "userid = ";
Private string yqhid;
Private webview web;
Private handler hand;
Private progressbar Pb;
Private myasynctask myasy;
@ Override
Protected void oncreate (bundle savedinstancestate ){
Super. oncreate (savedinstancestate );
Requestwindowfeature (window. feature_no_title );
Setcontentview (R. layout. help_webview );
Yqhid = getintent (). getstringextra ("yqhid ");
Web = (webview) findviewbyid (R. Id. help_webview1 );
Web. getsettings (). setbuiltinzoomcontrols (true); // you can zoom in or out.
Myasy = new myasynctask ();
Final string STR = urlhelp;
Myasy.exe cute (STR );
}
Class myasynctask extends asynctask <string, String, void> {
@ Override
Protected void doinbackground (string... Params ){
Web. loadurl (Params [0]);
Web. setwebchromeclient (New webchromeclient (){
@ Override
Public void onprogresschanged (webview view, int newprogress ){
Super. onprogresschanged (view, newprogress );
PB. setprogress (newprogress); // it handles the progress bar by itself
}
});
Return NULL;
}
@ Override
Protected void onpostexecute (void result ){
}
@ Override
Protected void onpreexecute (){
PB = (progressbar) findviewbyid (R. Id. help_progressbar2 );
PB. setprogress (0 );
}
}
}