expandable-recycler-view icon indicating copy to clipboard operation
expandable-recycler-view copied to clipboard

the parent onclicklistener not match the position

Open bsty2015 opened this issue 9 years ago • 10 comments

when I click the first parent item, the list show me the second children item, and all the items have the same problem, when i chick the last item, java.lang.IndexOutOfBoundsException, what's the problem?

bsty2015 avatar Dec 11 '15 02:12 bsty2015

Hi @bsty2015, is your data set changing and you haven't yet notified the adapter of the change? sounds like one item is being removed from the ArrayList of parent items, but without notifying the adapter click listener events may be off as well as crashes when accessing a list that has become smaller.

Let me know, otherwise I'll need a little bit more information (or maybe you can recreate the problem with the samples provided)

paul-turner avatar Dec 11 '15 22:12 paul-turner

I have to same problem too. I even set 2 function after I remove one 1 item from my array: adapter.notifyParentItemRemoved(position); adapter.notifyDataSetChanged();

they problem happend like when I have a list with 6 item, I expanded position num 2, and I remove 4 still good, but remove another like position 5 then it happend. that situation show me that include the number of children from parent position 2.

zajnbovv avatar Jan 18 '16 11:01 zajnbovv

@zajnbovv any chance you have sample code that recreates the problem?

paul-turner avatar Jan 18 '16 18:01 paul-turner

yes, please tell me how can I show you my sample please?

zajnbovv avatar Jan 19 '16 03:01 zajnbovv

Any update on this issue, I have got the same problem

toidv avatar Aug 23 '16 04:08 toidv

Sorry I missed the reply to this in January, would love a sample to recreate the problem. The sample can be given through Github using a public repository. Reopening for now.

paul-turner avatar Aug 23 '16 15:08 paul-turner

Any update on this issue, I have got the same problem?

alcntml avatar Mar 10 '17 13:03 alcntml

@alcntml Do you have a sample to recreate the problem I can look at?

paul-turner avatar Mar 31 '17 15:03 paul-turner

Hi: I have the same problem,When I use the XRecyclerView(https://github.com/jianghejie/XRecyclerView). I click the first parent item, the list show me the second children item.I think maybe is a header problem.hope your response

H-O-O avatar May 11 '17 11:05 H-O-O

Hi @Paul-turner I have some problem, Actually i have created a ExpandableRecyclerView with GridLayoutManager with 2 span count, so when i click on the Parent-view the the child view is expanding just next to parent-view but i want to expand it vertically. suppose two colmun is there then when clicked to the 1st column then its is expanding next to it but when cloumn 2nd item is clicked then there is no space so its is expanding below of it means on the 1st column side. but i want to expand each parent vertically. i am using the library 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1' please help

pushp17 avatar Sep 07 '18 20:09 pushp17