Hi i am new beginner in android. I want to insert image in imageView from URL but whenever one time it is loaded from URL in imageView then second time it should be insert without internet means it would be stored in cache as well.
You can make a view clickable, as a button, by adding the android:onClick attribute in the XML layout. For example, you can make an image act like a button by adding android:onClick to the ImageView .
2. src: src is an attribute used to set a source file or you can say image in your imageview to make your layout attractive.
for this you can use picasso Library You can download it from Picasso Library site simply put this jar file into libs folder. It will manage all property of Image. http://square.github.io/picasso/
String imgURL = "Your URL";
ivmage = (ImageView) findViewById(R.id.imageView1);
Picasso.with(MainActivity.this).load(imgURL).into(ivmage);
You can use Picasso
Library.
By Using Picasso
, The Advantages are
To load Image
from Url
Picasso.with(context).load(url).into(imageView);
Refer this link for Api : Picasso
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With