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

Commit da847e7f authored by Arc Wang's avatar Arc Wang
Browse files

Fix SettingsHomepageActivity crash during configuration change

Attempt to remove the animator to avoid a RecyclerView crash.

Bug: 260208703
Test: compile
Change-Id: I568cf964107f832fde4d82306fc84772bb208e20
parent 06125115
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -114,9 +114,14 @@ public class TopLevelHighlightMixin implements Parcelable, DialogInterface.OnSho
        }

        Log.d(TAG, "onCreateAdapter, pref key: " + mCurrentKey);

        // Remove the animator to avoid a RecyclerView crash.
        RecyclerView recyclerView = topLevelSettings.getListView();
        recyclerView.setItemAnimator(null);

        mTopLevelAdapter = new HighlightableTopLevelPreferenceAdapter(
                (SettingsHomepageActivity) topLevelSettings.getActivity(), preferenceScreen,
                topLevelSettings.getListView(), mCurrentKey, scrollNeeded);
                recyclerView, mCurrentKey, scrollNeeded);
        return mTopLevelAdapter;
    }