Skip to content

Commit

Permalink
Try workaround für #758 (#914)
Browse files Browse the repository at this point in the history
Try to work around the crash caused by an IllegalStateException by always returning a valid group view. Some change in Android seems to cause this. We'll keep this workaround until we've removed the `ExpandableListView`for good.
  • Loading branch information
dmfs authored Feb 1, 2020
1 parent aded3e7 commit e750aca
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@ public boolean hasStableIds()
}


@Override
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent)
{
try
{
return super.getGroupView(groupPosition, isExpanded, convertView, parent);
}
catch (IllegalStateException e)
{
// try to silence an issue which appears to be a race condition until we've gotten rid of ExpandableListView
// for now we just return an empty group view
return newGroupView(mContext, null /* we don't use this */, false, parent);
}
}


@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor)
{
Expand Down

0 comments on commit e750aca

Please sign in to comment.