I was trying to display a static HTML page in that Android app that contained some images in it. I had saved the image in the folder even more in the RAS / RAW folder. I was loading HTML file with this technique and also in the HTML file Ridge / Raw folder.
Super. Secret (Saved Instantstate); SetContentView (R.layout.main); MWebView = (webview) Find VVBID (RID webview); MWebView.getSettings () setJavaScriptEnabled (true). String data = resourcefullloadloadsstrostring (R.raw.temp, this); Last string mime type = "text / html"; Final String Encoding = "UTF-8"; MWebView.loadData (data, mime type, encoding);
I tried different ways to refer to the image.
-
img1.png, /img1.png, file: /// img1 Png, content: //img1.png
-
HTMLViewer / assets / img1.png, content: ///HtmlViewer/assets/img1.png and file: ///HtmlViewer/assets/img1.png
-
PackageName / Assets / img1.png, content: ///PackageName/assets/img1.png and file: /// packagename / property / img1.png
does anyone tell me How to get the path to the image?
file: ///android_asset/file_name.ext
this should work . Instead use this method LoadDataWithBaseURL ("file: /// android_asset /", summary, "text / html", "utf-8", tap);
Comments
Post a Comment