Dean
Dean

Reputation: 1084

Android WebView LoadUrl Error File Not Found

I started a blank activity in android studio, Added a Html file to "raw" folder. I created a webview and called function myWebView.loadUrl("file:///res/raw/test.html"). When running the app in the emulator, it shows file not found. Could anyone help? Phone EmulatorDir in Android Studio

Upvotes: 2

Views: 3915

Answers (1)

insomniac
insomniac

Reputation: 11756

Use this snippet

WebView myWebView = (WebView)findViewById(R.id.my_webview);
                lWebView.loadUrl("file:///android_res/raw/htmlfile.html");

Upvotes: 4

Related Questions