Hello Friends !! welcome back to https://yashajabiya.wordpress.com/ .
Today we learn about how to load image direct from URL :
So download .jar file and put into your libs folder . load with your build.gradle file on dependencies part :
now take one ImageView Control your xml file :
Cast into your .java file :
ImageView img = (ImageView) findViewById(R.id.img);
Load url image in your ImageView control using Picasso:
Picasso.with(contex) .load("https://yashajabiya.files.wordpress.com/2016/07/facebook_cover.jpg?") .placeholder(R.drawable.default_img) .error(R.drawable.error_img) .into(img);
Parameter & Description :
load : Pass url which you want to load image.
placeholder: It will show image as a place holder untill your url image not loaded fully on control.
error: It will show when loading process over and any problem occure with url then it show error drawable image.
Thank you :
If any query feel free to write here :