Fix rare NPE due to key being delivered after activity is stopped. #2062930

This commit is contained in:
Amith Yamasani
2009-08-25 15:40:14 -07:00
parent dbade9d6a0
commit 6ff5906981

View File

@@ -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: