No I'm not "whacking" the child views lol. I'm actually using the
remove(Object o) method to remove a row.  I am however using View.GONE
to hide a child view but that I know is not really deleting the view.
Anyway, I achieved what I was after by going at it using a different
method.  I still don't know why accessing the tag of the view would
give me a class cast exception when I know I set it to an Integer
inside the getView(...) method.


On May 20, 10:35 pm, Dianne Hackborn <[email protected]> wrote:
> You say you are trying to delete rows in the list view by whacking the child
> views of ListView?  Um, don't do that.  ListView manages its views.
>
>
>
>
>
>
>
>
>
> On Fri, May 20, 2011 at 3:47 PM, Wall-E <[email protected]> wrote:
>
> > 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
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
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

Reply via email to