Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit e750aca2 authored by Marten Gajda's avatar Marten Gajda Committed by GitHub
Browse files

Try workaround für #758 (#914)

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.
parent aded3e7c
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -112,6 +112,22 @@ public class ExpandableGroupDescriptorAdapter extends CursorTreeAdapter implemen
    }


    @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)
    {