Display Image In Imageview
In Android How can i display image from the live heroku hosted url in the Imageview control or any other image displays controls?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Deepak BajajRank #70 · 25.7K reputationPosted May 31, 2017, 8:28 PM EDT
private Bitmap convertImageUrlToBitmap(String url) { try { URL imageUrl=new URL(url); HttpURLConnection connection=(HttpURLConnection)imageUrl.openConnection(); connection.setDoInput(true); connection.connect(); InputStream inputStream=connection.getInputStream(); Bitmap bitmap=BitmapFactory.decodeStream(inputStream); return bitmap; } catch (MalformedURLException e) { e.printStackTrace(); return null; } catch (IOException e) { e.printStackTrace(); return null; }