Android Development: Using Image From Assets In A WebView's HTML

后端 未结 6 2065
星月不相逢
星月不相逢 2020-11-28 07:37

In my app I\'m making a basic HTML help document. I wanted my app\'s logo in the HTML img tag itself, but I don\'t know how I\'d reference to the logo which will be stored i

6条回答
  •  佛祖请我去吃肉
    2020-11-28 08:16

    Put your Logo into the assets directory Example : assets/logo.png

    Then

    String imgData="";
    
    webView.loadDataWithBaseURL("file:///android_asset/", imgData, "text/html", "utf-8", null);
    

提交回复
热议问题