0

i want to show the image on the following link in the webview in my android app. any idea how to do that ? image link is given below. image link

ALi Hamza
  • 17
  • 6

2 Answers2

0

Your link is broken.

  • If you want to show remote images in imageview you can use 3rd party library like Picasso.

  • Without using 3rd party library check this question

  • If you want to load image in webview use web.load(url).

Community
  • 1
  • 1
Muhammed GÜNEŞ
  • 304
  • 2
  • 15
0

Please check below code use into Activity On Create

WebView webView = (WebView) findViewById(R.id.mwebview);   

 String mStringUrl = "http://api.androidhive.info/images/sample.jpg";

    webView.loadDataWithBaseURL(null, "<html><head></head><body><table style=\"width:100%; height:100%;\"><tr><td style=\"vertical-align:middle;\"><img src=\"" + mStringUrl + "\"></td></tr></table></body></html>", "html/css", "utf-8", null);

OR

WebView webView = (WebView) findViewById(R.id.mwebview);   
String mStringUrl = "http://api.androidhive.info/images/sample.jpg";

webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(mStringUrl);

In XML

<WebView
    android:id="@+id/mwebview"
    android:layout_width="fill_parent"
    android:layout_height="250dp"></WebView>  
Yogesh Borhade
  • 694
  • 1
  • 10
  • 24