am 75d60f04: Merge "Null check mCheckFrequency before using" into ub-mail-algol

* commit '75d60f045b8344f7a894e895c1bd95957f5e24bf':
  Null check mCheckFrequency before using
This commit is contained in:
Tony Mantler 2014-04-16 17:20:17 +00:00 committed by Android Git Automerger
commit 131baa26a1
1 changed files with 10 additions and 4 deletions

View File

@ -212,15 +212,21 @@ public class AccountSettingsFragment extends PreferenceFragment
final CharSequence [] syncIntervals =
savedInstanceState.getCharSequenceArray(SAVESTATE_SYNC_INTERVALS);
mCheckFrequency = (ListPreference) findPreference(PREFERENCE_FREQUENCY);
mCheckFrequency.setEntries(syncIntervalStrings);
mCheckFrequency.setEntryValues(syncIntervals);
if (mCheckFrequency != null) {
mCheckFrequency.setEntries(syncIntervalStrings);
mCheckFrequency.setEntryValues(syncIntervals);
}
}
}
public void onSaveInstanceState(Bundle outstate) {
super.onSaveInstanceState(outstate);
outstate.putCharSequenceArray(SAVESTATE_SYNC_INTERVAL_STRINGS, mCheckFrequency.getEntries());
outstate.putCharSequenceArray(SAVESTATE_SYNC_INTERVALS, mCheckFrequency.getEntryValues());
if (mCheckFrequency != null) {
outstate.putCharSequenceArray(SAVESTATE_SYNC_INTERVAL_STRINGS,
mCheckFrequency.getEntries());
outstate.putCharSequenceArray(SAVESTATE_SYNC_INTERVALS,
mCheckFrequency.getEntryValues());
}
}
@Override