Thursday, May 17, 2012

[android-developers] Re: onChildViewRemoved triggered only by the last child

If I were you, I would check the way you are removing the children,
first. If you are removing child views "at once" like removing a
ViewGroup to which the child Views belong, instead of removing one
View at a time, this behavior makes sense as hierarchy change is
happening only once for multiple removals.

If you are removing one View at a time, then I would analyze
OnHierarcyChangeListener() source, use your own version of it after
changing where it is causing the issue, then report what you've done.
This is the beauty (and sometimes agony) of being an Android
developer, don't you think?

On May 14, 9:45 pm, Bob <robertoo...@gmail.com> wrote:

> private OnHierarchyChangeListener grdCategoriesHieararchyChangeHandler
> = new OnHierarchyChangeListener() {
> @Override
> public void onChildViewRemoved(View parent, View child) {
>     LinearLayout bc = (LinearLayout)findViewById(R.id.newCategory);
>     if (bc.getVisibility() == View.INVISIBLE)
>         bc.setVisibility(View.VISIBLE);
> }
>
> @Override
> public void onChildViewAdded(View parent, View child) {
>     if (mCategories.getCount() >= 9)
>     {
>         LinearLayout bc =
> (LinearLayout)findViewById(R.id.newCategory);
>         bc.setVisibility(View.INVISIBLE);
>     }
> }
> };

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate