Fix NullPointerException in DashboardSummary.
In onSaveInstanceState(), move saving the suggestions logging lists to the top so that it will be saved to the bundle even when layout manager is null. Test: run monkey Change-Id: I248563a255158feadeb85898a920af96a1565fa9 Fixes:31111795
This commit is contained in:
@@ -178,13 +178,13 @@ public class DashboardSummary extends InstrumentedFragment
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putStringArrayList(EXTRA_SUGGESTION_HIDDEN_LOGGED, mSuggestionsHiddenLogged);
|
||||
outState.putStringArrayList(EXTRA_SUGGESTION_SHOWN_LOGGED, mSuggestionsShownLogged);
|
||||
if (mLayoutManager == null) return;
|
||||
outState.putInt(EXTRA_SCROLL_POSITION, mLayoutManager.findFirstVisibleItemPosition());
|
||||
if (mAdapter != null) {
|
||||
mAdapter.onSaveInstanceState(outState);
|
||||
}
|
||||
outState.putStringArrayList(EXTRA_SUGGESTION_HIDDEN_LOGGED, mSuggestionsHiddenLogged);
|
||||
outState.putStringArrayList(EXTRA_SUGGESTION_SHOWN_LOGGED, mSuggestionsShownLogged);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user