我正在使用 Android Studio Dolphin 2021.3.1
我有一個 WebView 設定如下:
val wb = WebView(this)
wb.loadUrl("file:///android_assets/html/About.html")
setContentView(wb)
我有一個資產檔案夾設定如下:
[資產檔案夾結構][1]
在專案磁盤位置:
MyApp/app/src/main/assets/html
但是當顯示 WebView 我得到
凈::ERR_FILE_NOT_FOUND
有人可以建議我如何訪問這樣的檔案嗎?我在磁盤上的位置錯誤嗎?[1]:https ://i.stack.imgur.com/c5Ury.png
uj5u.com熱心網友回復:
使用這樣的網址"file:///android_asset/html/About.html" 而android_asset不是android_assets
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/520727.html
