L permission inmanifest:
<Uses-Permission
Android: Name ="Android. Permission. write_external_storage"/>
L save Web page tosdcard:
// Get file name
String filename = webview1.copybackforwardlist (). getcurrentitem ()
. Gettitle ();
// Save fileSdcard
Webview1.savewebarchive ("/sdcard /"
+ Environment.Directory_downloads+
"/" + Filename
+ ". Webarchivexml ",
False,NewValuecallback <string> (){
@ Override
Public
VoidOn1_evalue (string value ){
If(Value =
Null){
// Save failed
Toast.Maketext(Getapplicationcontext (),
"Savepage failed.", toast.Length_long). Show ();
}Else{
// File saved, show message
Toast.Maketext(Getapplicationcontext (), value
+
"Has been saved", toast.Length_long). Show ();
}
}
});
L read webpage archive saved:
// Open saved file from
Sdcard
Webview1.loadurl ("file: // sdcard /"
+ Environment.Directory_downloads+
"/" + Filename + ". webarchivexml ");