Advertisement
Guest User

Untitled

a guest
Sep 10th, 2012
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. package com.bc.ViewWeb;
  2.  
  3. import android.app.Activity;
  4. import android.os.Bundle;
  5. import android.webkit.WebView;
  6. import android.webkit.WebViewClient;
  7.  
  8. public class ViewWebActivity extends Activity {
  9. /** Called when the activity is first created. */
  10. @Override
  11. public void onCreate(Bundle savedInstanceState) {
  12. super.onCreate(savedInstanceState);
  13. setContentView(R.layout.main);
  14. String myURL="file:///android_asset/hello.html";
  15. String mime="text/html";
  16. String encoding="utf-8";
  17.  
  18. WebView wv=(WebView)findViewById(R.id.webView1);
  19. wv.getSettings().setJavaScriptEnabled(true);
  20. wv.setWebViewClient(new WebViewClient());
  21. wv.loadDataWithBaseURL(myURL, myURL, mime, encoding, myURL);
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement