requestLayout() improperly called by Listview

Asked

Viewed 42 times

1

I have the following error, when I call my screen of categories they load normally, I go to the second tab called expense that loads a list, so everything well, when returning to the first tab, the logcat is like crazy repeating the following message:

06-11 18:46:20.770    4961-4961/com.prjctt.allan.newfinance W/View﹕ requestLayout() improperly called by com.prjctt.allan.newfinance.ExpandedListView{225d8596 VFED..C. .F....ID 0,86-316,209 #102000a android:id/list} during layout: running second layout pass
06-11 18:46:20.795    4961-4961/com.prjctt.allan.newfinance W/View﹕ requestLayout() improperly called by com.prjctt.allan.newfinance.ExpandedListView{225d8596 VFED..C. .F...... 0,86-316,209 #102000a android:id/list} during second layout pass: posting in next frame
06-11 18:46:20.834    4961-4961/com.prjctt.allan.newfinance W/View﹕ requestLayout() improperly called by com.prjctt.allan.newfinance.ExpandedListView{225d8596 VFED..C. .F....ID 0,86-316,209 #102000a android:id/list} during layout: running second layout pass
06-11 18:46:20.867    4961-4961/com.prjctt.allan.newfinance W/View﹕ requestLayout() improperly called by com.prjctt.allan.newfinance.ExpandedListView{225d8596 VFED..C. .F...... 0,86-316,209 #102000a android:id/list} during second layout pass: posting in next frame
06-11 18:46:20.901    4961-4961/com.prjctt.allan.newfinance W/View﹕ requestLayout() improperly called by com.prjctt.allan.newfinance.ExpandedListView{225d8596 VFED..C. .F....ID 0,86- 16,209 #102000a android:id/list} during layout: running second layout pass
06-11 18:46:20.928    4961-4961/com.prjctt.allan.newfinance W/View﹕ requestLayout() improperly called by com.prjctt.allan.newfinance.ExpandedListView{225d8596 VFED..C. .F...... 0,86-316,209 #102000a android:id/list} during second layout pass: posting in next frame
06-11 18:46:21.039    4961-4961/com.prjctt.allan.newfinance W/View﹕ requestLayout() improperly called by com.prjctt.allan.newfinance.ExpandedListView{225d8596 VFED..C. .F....ID 0,86-316,209 #102000a android:id/list} during layout: running second layout pass

Could you help me? I’ve been making this mistake all day. Detail, the emulator is very slow when the logcat gets that way..

gif for better understanding : erro request

Class of custom Listview

   public ExpandedListView(Context context, AttributeSet attrs) {
    super(context, attrs);
}


@Override
protected void onDraw(Canvas canvas) {
    if (getCount() != old_count) {
        old_count = getCount();
        params = getLayoutParams();
        params.height = getCount() * (old_count > 0 ? getChildAt(0).getHeight() : 0);
        setLayoutParams(params);
    }

    super.onDraw(canvas);
}
}

xml of the list

<com.prjctt.allan.newfinance.ExpandedListView
    android:layout_width="wrap_content"
    android:layout_height="?android:attr/listPreferredItemHeightLarge"
    android:id="@android:id/list"
    android:scrollbars="none"
    android:padding="0dp"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_below="@+id/btAddSubCat"/>
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.