I have few images which are retrieved from my web service.
I want to display these images in grid view in android.
How can i do this??
Thanks,
Sneha
See the following url to create a gridview
you have to set image inside getView()
method
If you have image in the form of bitmap then use
imageview.setImageBitmap(bm);
If you have image in the form of drawable then use
imageview.setImageDrawable(drawable);
If you have image in your resource example if image is present in drawable folder then use
imageview.setImageResource(R.drawable.image);
If you have path of image then use
imageview.setImageURI(Uri.parse("pathofimage));
If you have image in byte array format then you can convert that byte array into Bitmap and use any of the above method.
Thanks Deepak
There are different image loader libraries which will help to load these images in ImageView
Inside getView() use:
Picasso library:
Picasso.with(mContext).load("http://url.com/image.jpeg")into(imageView);
or Glide library:
Glide.with(mContext).load("").into(imageView)
Read this article about three image loader library.