[Toast] Fix the NPE in isPersonalTab().

Don't set mUsingTab until replaceRVContainer is done.

Bug: 224882720
Test: manual
Change-Id: I9ebec067d06df5e890ffe3c90d49f1de51b3b981
This commit is contained in:
Becky Qiu
2022-05-06 16:57:46 -07:00
parent 8217fce33e
commit f0fd3d8e2e

View File

@@ -437,8 +437,12 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
if (showTabs == mUsingTabs && !force) {
return;
}
// replaceRVcontainer() needs to use both mUsingTabs value to remove the old view AND
// showTabs value to create new view. Hence the mUsingTabs new value assignment MUST happen
// after this call.
replaceRVContainer(showTabs);
mUsingTabs = showTabs;
replaceRVContainer(mUsingTabs);
mAllAppsStore.unregisterIconContainer(mAH.get(AdapterHolder.MAIN).mRecyclerView);
mAllAppsStore.unregisterIconContainer(mAH.get(AdapterHolder.WORK).mRecyclerView);