0

How do I display image from url in textview? the url is say http://demo/image.jpeg and I have a text view. Android - Display Image from url on textview this link the fromhtml is deprecated. Picasso is a good way, but I have to use textview and image is from url. TextView.setDrawables won't work I guess.

Lino
  • 5,084
  • 3
  • 21
  • 39
  • Take an ImageView if you have an image. – blackapps Nov 09 '20 at 19:49
  • You could try and convert it to a Drawable, but why can't you just use an ImageView? – PPartisan Nov 09 '20 at 20:33
  • Get a bitmap from source URL then you can use ImageSpan with Bitmap. When you get an image as bitmap, follow these answer (https://stackoverflow.com/a/25522359/1214847). As you wanted, you will see image in a textView. – zapdroid Nov 09 '20 at 21:26

1 Answers1

0

Why not just use Glide, it's much better than Picasso in my opinion.

Glide.with(this)
.load(textView.getText().toString())
.into(imageView);
Regex
  • 528
  • 4
  • 20