Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load html file stored inside SD card in the web view

I have an html file in /mnt/sdcard/packagename/files/something.html path. Now I want to load this file into the webview.

When I surfed for this, I heard something about content provider, but still not cleared exactly how to do it.

Any answer?

Thanks in advance,

Tejaswi Marakini

like image 494
tejas Avatar asked Dec 02 '22 00:12

tejas


1 Answers

if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)){
            Log.d(TAG, "No SDCARD");
} else {
webComp.loadUrl("file://"+Environment.getExternalStorageDirectory()+"/packagename/files/something.html");
}
like image 163
user370305 Avatar answered Dec 28 '22 10:12

user370305