I'm iterating through a ListView and getting it's child views using
the getChildAt(position) method as follows:
for(int i = 0; i < listView.getChildCount(); i++)
{
View lView = (View) listView.getChildAt(i);
.
.
.
}
Now inside getView in my ArrayAdapter I set one of the views(an
ImageView) tag to the position. I'm setting it for every instance of
that view that gets created. So what I'm trying to do is to iterate
all the list item views and check to see if this ImageView is visible
or not and if it is, then I set the visibility to GONE. Now all is
fine and well until my app crashes with a Class Cast Exception and the
reason being is because I try to access the tag from the ImageView
using imageView.getTag() and casting it as an Integer but the Object
being returned must not be an Integer. Now as I've stated before I'm
sure I'm storing the position inside the getView(...) method in my
ArrayAdapter, so why would the view return something other than an
Integer? Is the listView using an newly created instance of the view
that I'm not aware of and if so what is the best way to iterate the
listView to get a certain instance of the imageView to check its
visibility?
Is there a project already out there that has implemented the deleting
of rows in a listview that I can reference?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en