SHARE
TWEET

Untitled

a guest Mar 21st, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. WebView view = new WebView(this);
  2. view.getSettings().setJavaScriptEnabled(true);
  3. view.loadUrl("file:///android_asset/chart.html");
  4. setContentView(view);
  5.    
  6. WebView view = new WebView(this);
  7. view.getSettings().setJavaScriptEnabled(true);
  8. view.loadUrl("file:///android_asset/hello.html");
  9. setContentView(view);
  10.    
  11. try {
  12.         AssetManager assetManager = context.getAssets();
  13.         InputStream stream = assetManager.open("page.html");
  14.         BufferedReader r = new BufferedReader(new InputStreamReader(stream));
  15.         StringBuilder total = new StringBuilder();
  16.         String line;
  17.         while ((line = r.readLine()) != null) {
  18.             total.append(line).append("n");
  19.         }
  20.         webView.loadDataWithBaseURL(null, total.toString(), "text/html", "UTF-8", null);
  21.     } catch (Exception xxx) {
  22.         Log.e(TAG, "Load assets/page.html", xxx);
  23.     }
RAW Paste Data
Pastebin PRO Summer Special!
Get 60% OFF on Pastebin PRO accounts!
Top