Android HTML resource with references to other resources

前端 未结 2 1133
忘掉有多难
忘掉有多难 2021-01-06 06:33

I would like to add an HTML resource to my Android project with references to other resources (mainly drawables).

Where should I put it and how do I reference other

相关标签:
2条回答
  • 2021-01-06 07:17

    The html file goes into the assets folder in root (as a sibling folder of res), as well as all the drawables. You can view it by doing something like

    webView.loadUrl("file:///android_asset/filename.html");
    
    0 讨论(0)
  • 2021-01-06 07:17

    If your file is on the SD card, this reference will work:

    content://com.android.htmlfileprovider/sdcard/filename.jpg

    0 讨论(0)
提交回复
热议问题