![]() ![]() ![]() Here i put black_gif. Try this, bellow code display gif file in progressbar Suggestion: is better load gif with static images for more information check WebView.loadDataWithBaseURL(base + '/', yourData, "text/html", "utf-8", null) String base = Environment.getExternalStorageDirectory().getAbsolutePath().toString() Or if you want to load image from SD card or where else, here is the idea. WebView.loadDataWithBaseURL("file:///android_asset/", yourData, "text/html", "utf-8", null) BaseUrl could be the base url such as the path to asset folder, or SDCard or any other path, where your images or the other media resides related to your html Choose from over 11k clips today with royalty free licensing available to use on any project. Notice: should use loadDataWithBaseURL. Free motion graphics and animated backgrounds with free HD and 4K video clips to use in your motion video projects, vj loops, backgrounds, graphical overlays, production elements. WebView.getSettings().setAllowFileAccess(true) Important to add this attribute to webView to get resource from outside. If you want load dynamically you have to load the webview with data: // or "/name.gif" (e.g: file:///android_asset/name.gif for resources in asset folder), and in loadDataWithBaseURL(), you don't need to set base URL, on the other hand, it's similar to loadData() method. Web.loadUrl("file:///android_asset/htmls/name.html") Web.setBackgroundColor(Color.TRANSPARENT) //for gif without background In your Activity put the next code inside of onCreate web = (WebView) findViewById(R.id.webView) Also put (main/assets/htmls/name.gif) ĭeclare in your Xml for example like this (main/res/layout/name.xml): ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |