
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Android 4.0.1 Breaks WebView HTML5 Local Storage
To solve this problem, follow the below-given steps −
For android versions less than 4.4, loading data into a webview with a file scheme as a directory like this won’t work.
browser.loadDataWithBaseUrl("file:///android_asset/", html, "text/html", "UTF-8", null);
Add a filename and it works on older Android versions −
browser.loadDataWithBaseUrl("file:///android_asset/new.html", htmlContent, "text/html", "UTF-8", null);
You can use the following too, in case your URL is http://www.demo.com −
browser.loadDataWithBaseURL("http://www.demo.com", htmlContent, "text/html", "utf-8", null);
Advertisements