-1

I have a bitmap on Activity and I want to set that bitmap to an ImageView in a group in an ExpandableListView.
How can I do this?

Bitmap bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(uri));                      (Expandablelistview.imageview).setImageBitmap(bitmap);

I need a particular group of my ExpandableListView and then set that ImageView there.
I need this View reference in the Activity.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Zaki Pathan
  • 1,762
  • 1
  • 13
  • 26

1 Answers1

0

create array of holders

  ArrayList<ViewHolder> holders = new ArrayList<>();


public class ViewHolder {
    ImageView iv;
}

@Override
public View getGroupView(int i, boolean b, View view, ViewGroup viewGroup) {

   ViewHolder holder = new ViewHolder();
    holder.iv = (ImageView)view.findViewById(R.id.imageView);
    holders.add(holder);
    return null;

}

hope you have idea about ViewHolders.. and finally in your activity find the view by the following code and set imageview

holders.get(POSITIONOFLIST).iv.setImageBitmap(bitmap);

hope it helps.

Mr.Popular
  • 845
  • 1
  • 8
  • 15