Android using Localstorage

Source: Internet
Author: User

PS: itself is. NET birth because the project needs to study several days of Android This method online also have their own also write to have time to see themselves and to the friends who have not solved the problem, the following is a key to allow the use of localstorage
This can only be used Localstorage is currently studying how to use it to store in the app and so on.
protected void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
//Instantiation ofWebViewObject
WebView =New WebView (this);
//Set upWebViewproperty that can performJavascriptScript
Webview.getsettings (). setjavascriptenabled (true);
Webview.getsettings (). setdomstorageenabled (true);//Focus
String Appcachepath = Getapplicationcontext (). Getcachedir (). GetAbsolutePath ();
Webview.getsettings (). Setappcachepath (Appcachepath);
Webview.getsettings (). Setallowfileaccess (true);
Webview.getsettings (). setappcacheenabled (true);
JsPop
Webview.setwebchromeclient (New Webchromeclient ());
try {
//Set the address of an open page
Webview.loadurl ("http://192.168.16.39:8901/");
Webview.setwebviewclient (New Webviewclient () {
Public Boolean shouldoverrideurlloading (WebView view, String URL) {
// Override this method to indicate that clicking on a link in the Web page or jumping in the current WebView does not jump to the browser
View.loadurl (URL);
return true;
}
});
}
catch (Exception ex)
{
Ex.printstacktrace ();
}
Setcontentview (webview);}

Android using Localstorage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.