diff options
author | Amith Yamasani <yamasani@google.com> | 2009-08-25 15:40:14 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2009-08-25 15:42:55 -0700 |
commit | 6ff5906981fac2aa67c8c1f0df151b536e80ccaf (patch) | |
tree | 04f3ff21e9ad54e8fe92449f12c084e3b202370c /core/java/android/preference | |
parent | dbade9d6a075b1d5b8ebe10ee8961a5de296c93b (diff) | |
download | frameworks_base-6ff5906981fac2aa67c8c1f0df151b536e80ccaf.zip frameworks_base-6ff5906981fac2aa67c8c1f0df151b536e80ccaf.tar.gz frameworks_base-6ff5906981fac2aa67c8c1f0df151b536e80ccaf.tar.bz2 |
Fix rare NPE due to key being delivered after activity is stopped. #2062930
Diffstat (limited to 'core/java/android/preference')
-rw-r--r-- | core/java/android/preference/VolumePreference.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/preference/VolumePreference.java b/core/java/android/preference/VolumePreference.java index 46cce52..b337d28 100644 --- a/core/java/android/preference/VolumePreference.java +++ b/core/java/android/preference/VolumePreference.java @@ -78,6 +78,8 @@ public class VolumePreference extends SeekBarPreference implements } public boolean onKey(View v, int keyCode, KeyEvent event) { + // If key arrives immediately after the activity has been cleaned up. + if (mSeekBarVolumizer == null) return true; boolean isdown = (event.getAction() == KeyEvent.ACTION_DOWN); switch (keyCode) { case KeyEvent.KEYCODE_VOLUME_DOWN: |