OSDN Git Service

Avoid launching dialogs twice from double-clicking a preference.
authorAmith Yamasani <yamasani@google.com>
Thu, 17 May 2012 00:02:32 +0000 (17:02 -0700)
committerAmith Yamasani <yamasani@google.com>
Thu, 17 May 2012 00:02:32 +0000 (17:02 -0700)
Bug: 6500628

Only create the dialog if another one doesn't already exist.

Change-Id: Ie9be06a58c369299bcb67526e668785e6735a307

core/java/android/preference/DialogPreference.java

index c59ed18..a643c8a 100644 (file)
@@ -261,6 +261,8 @@ public abstract class DialogPreference extends Preference implements
     
     @Override
     protected void onClick() {
+        if (mDialog != null && mDialog.isShowing()) return;
+
         showDialog(null);
     }