diff options
author | Daisuke Miyakawa <dmiyakawa@google.com> | 2010-08-28 15:59:56 -0700 |
---|---|---|
committer | Daisuke Miyakawa <dmiyakawa@google.com> | 2010-08-30 11:52:35 -0700 |
commit | 3f10b1c8f841113b93d2dfecdd84a1dfb1008faf (patch) | |
tree | 293dd5b71c232d6ce01dfc8a86a932e4a0aae16a /core/java/android/widget/Spinner.java | |
parent | 3a23a3f367315e8ea0cd9ecde8d27fd8ea20889f (diff) | |
download | frameworks_base-3f10b1c8f841113b93d2dfecdd84a1dfb1008faf.zip frameworks_base-3f10b1c8f841113b93d2dfecdd84a1dfb1008faf.tar.gz frameworks_base-3f10b1c8f841113b93d2dfecdd84a1dfb1008faf.tar.bz2 |
Fix NPE when Spinner is reused.
Bug: 2958228
Change-Id: I2c5e322b92fd4896361d02a307d0ba0ef3d33029
Diffstat (limited to 'core/java/android/widget/Spinner.java')
-rw-r--r-- | core/java/android/widget/Spinner.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java index b534c34..58c2613 100644 --- a/core/java/android/widget/Spinner.java +++ b/core/java/android/widget/Spinner.java @@ -78,7 +78,7 @@ public class Spinner extends AbsSpinner implements OnClickListener { mPopup = new DialogPopup(); break; } - + case MODE_DROPDOWN: { final int hintResource = a.getResourceId( com.android.internal.R.styleable.Spinner_popupPromptView, 0); @@ -144,7 +144,6 @@ public class Spinner extends AbsSpinner implements OnClickListener { if (mPopup != null && mPopup.isShowing()) { mPopup.dismiss(); - mPopup = null; } } @@ -316,7 +315,6 @@ public class Spinner extends AbsSpinner implements OnClickListener { public void onClick(DialogInterface dialog, int which) { setSelection(which); dialog.dismiss(); - mPopup = null; } /** @@ -542,7 +540,8 @@ public class Spinner extends AbsSpinner implements OnClickListener { mHintView.setText(hintText); } } - + + @Override public void show() { if (mHintView == null) { final TextView textView = (TextView) LayoutInflater.from(getContext()).inflate( |