Skip to main content

Posts

Showing posts with the label loadurl

Load html file to WebView from assets in Android

Put the html file inside asset folder and use the code given below : public class MainActivity extends Activity { WebView myWebView; TextView tv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); myWebView=(WebView) findViewById(R.id.webView1); myWebView.loadUrl("file:///android_asset/Noun.htm"); } Copy and download the code and try your self.