Rakesh
Rakesh

Reputation: 273

ArrayList of Bitmap

Hi, I want to display the last Bitmap from a list of bitmaps to an ImageView. Here is my code:

SubImageView = (ImageView) findViewById(R.id.SubImageView);
ArrayList<Bitmap> bitmapArray = new ArrayList<Bitmap>();
bitmapArray.add(myBitMap);

Upvotes: 1

Views: 12613

Answers (1)

Samir Mangroliya
Samir Mangroliya

Reputation: 40416

if(bitmapArray.size() > 0)
{
  int index = bitmapArray.size() -1;
  Bitmap lastbitmap = bitmapArray.get(index);

  SubImageView.setImageBitmap(lastbitmap);
}

Upvotes: 4

Related Questions