-3

i am programming an app with AndroidStudio and want to use an ImageButton to Display an Image. The Problem is, that this Image is from the Internet and I just found a method to use Pictures in the R.mipmap.*** for the ImageButton.

Does anyone have an idea how it may work

Thankyou

Prog Rammer

  • What do you mean by _"from the Internet"_? And what is the problem with using the _"method to use Pictures in R.mipmap.***"_? – Gino Mempin Jul 24 '18 at 02:04
  • What have you tried so far? Do you have any code you can share? As is there is no way for us to help you with this question. – Max von Hippel Jul 24 '18 at 04:40

1 Answers1

0

If you want to load an image from the internet, I recommend you use an Image library like Glide or Picasso for this. Create an ImageView with an OnClickListener on it, then call the library's load(...) method with the image url.

The mipmap folders are for placing your app/launcher icons, and should not be used for placing assets in app.

I believe using the Image Library mentioned is the simplest solution, since loading an Image from the internet on your own takes a lot of boilerplate code.

  • Thx. I have an othe question: There is a possibility to change the events of Button Back and Volume down/up and so on, you need the KEYCODE for...do you know the KEYCODE for the on/off button of the mobile? – Prog Rammer Jul 24 '18 at 23:40