Android-SlideExpandableListView icon indicating copy to clipboard operation
Android-SlideExpandableListView copied to clipboard

Derived class did not call super.onsaveinstancestate() - SlideExpandableListView

Open MattWilliams89 opened this issue 12 years ago • 1 comments

I was using an ActionSlideExpandableListView in a fragment and when replacing this fragment, before the adapter to the ListView was set, I had the above Exception thrown.

I fixed the issue by changing the onSaveInstanceState() function in SlideExpandableListView to :

@Override
public Parcelable onSaveInstanceState() {
    if ( adapter != null )
    {
        return adapter.onSaveInstanceState(super.onSaveInstanceState());
    }
    else
    {
        return super.onSaveInstanceState();
    }
}

where it used to say "return null" in the else case. This fixed the issue for me

MattWilliams89 avatar Jun 20 '13 16:06 MattWilliams89

Worked for me too, otherwise it was crashing on going bakcground and coming back after the fragment has been destroyed. Should it be added to official code?

sergiandreplace avatar Jan 26 '14 17:01 sergiandreplace