Failed to get contact for voicemail after switch language
VoicemailSettingsActivity destroy and creat after switch language,receive onActivityResult,due to mSubMenuVoicemailSettings is null and don't update the number.
Bug: 162189775
Change-Id: I8a57ce882c9c68883ba6b772b4fb974877ff88bb
diff --git a/src/com/android/phone/settings/VoicemailSettingsActivity.java b/src/com/android/phone/settings/VoicemailSettingsActivity.java
index 66b1af9..2bd5306 100644
--- a/src/com/android/phone/settings/VoicemailSettingsActivity.java
+++ b/src/com/android/phone/settings/VoicemailSettingsActivity.java
@@ -238,6 +238,10 @@
mVoicemailNotificationPreference =
findPreference(getString(R.string.voicemail_notifications_key));
+ if (mSubMenuVoicemailSettings == null) {
+ mSubMenuVoicemailSettings =
+ (EditPhoneNumberPreference) findPreference(BUTTON_VOICEMAIL_KEY);
+ }
final Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_CHANNEL_ID,
NotificationChannelController.CHANNEL_ID_VOICE_MAIL);
@@ -250,12 +254,6 @@
super.onResume();
mForeground = true;
- PreferenceScreen prefSet = getPreferenceScreen();
-
- if (mSubMenuVoicemailSettings == null) {
- mSubMenuVoicemailSettings =
- (EditPhoneNumberPreference) findPreference(BUTTON_VOICEMAIL_KEY);
- }
if (mSubMenuVoicemailSettings != null) {
mSubMenuVoicemailSettings.setParentActivity(this, VOICEMAIL_PREF_ID, this);
mSubMenuVoicemailSettings.setDialogOnClosedListener(this);