android-empty-layout icon indicating copy to clipboard operation
android-empty-layout copied to clipboard

Crash the SwipeRefreshLayout

Open yoavst opened this issue 11 years ago • 1 comments

SwipeRefreshLayout (from support v4 19.1) can has only 1 child. Currently my solution is to check if the parent is that, and then get its parent (should also check if he has parent, but in my code it always has a parent):

ViewGroup parent = (ViewGroup) mListView.getParent();
            // Start editing
            if (parent instanceof SwipeRefreshLayout) {
                parent = (ViewGroup) parent.getParent();
            }
            // End editing

yoavst avatar Mar 28 '14 11:03 yoavst

you can try to change your layout like this:

SwipeRefreshLayout > LinearLayout> ListView /> /LinearLayout> /SwipeRefreshLayout >

Good luck!

jtyang avatar Apr 24 '14 16:04 jtyang