0

I am using a ListView with a BaseAdapter. Each row in the ListView has a LinealLayout and 2 ImageView.

My problem is that I need to change the alpha of the image from my Activity but I don't manage to do it.

I have tried to do it like that:

View v = listAdapter.getView(2, null, null);
ImageView img = (ImageView)v.findViewById(R.id.secondImage);
img.setAlpha(1000);
listAdapter.notifyDataSetChanged();

But after that, I can't see the new changes. Another way that I thought was using listView.getChildAt() but it always returns a Null object. What is the right way?

Thanks

grouser
  • 618
  • 8
  • 23
  • You may want to set correct answers in your previous questions. – MaciejGórski Apr 07 '13 at 10:12
  • You could use the same method I described [here][1]. [1]: http://stackoverflow.com/a/15070130/1685143 – Gordak Apr 07 '13 at 10:18
  • The situation is different. At the beginning all the images don't have alpha, so then I have to set it. So getView() is called before. – grouser Apr 07 '13 at 10:27
  • Well just call notifyDataSetChanged() once you have changed the alpha values. This will redraw the View. – Gordak Apr 07 '13 at 10:37

0 Answers0