From 69621ece97d9f82e7408562f28110f40d872cb24 Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Fri, 5 Oct 2012 12:39:29 -0700 Subject: [PATCH] Locale selection settings do not hide warning dialog. 1. If there is more than one user on the device and a user tries to modify the locale which is shared across all users we are showing a warning dialog. When the user selects OK we are changing the locale and going to the previous screen. This is achieved by removing the locale selection fragment from the backstack. The problem was that the dialog was not dismissed upon OK in the dialog which resulted in saving the dialog's state and an attempt to restore it on the wrong fragment which has no idea about this dialog, this returning a null dialog resulting in a crash. This change removes the dialog on OK selection. bug:7265186 Change-Id: I336ab54f5281c7a9ae24f1c25769daac46477ebd --- src/com/android/settings/LocalePicker.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/android/settings/LocalePicker.java b/src/com/android/settings/LocalePicker.java index 1272ddce12..5827ef728a 100644 --- a/src/com/android/settings/LocalePicker.java +++ b/src/com/android/settings/LocalePicker.java @@ -17,9 +17,7 @@ package com.android.settings; import android.app.Dialog; -import android.content.Context; import android.os.Bundle; -import android.os.UserManager; import android.util.Log; import com.android.settings.SettingsPreferenceFragment.SettingsDialogFragment; @@ -83,6 +81,7 @@ public class LocalePicker extends com.android.internal.app.LocalePicker R.string.global_locale_change_title, new Runnable() { public void run() { + removeDialog(dialogId); getActivity().onBackPressed(); LocalePicker.updateLocale(mTargetLocale); } -- 2.11.0