When on-screen setting is visible and home key is pressed,
onPause will set mSetting to invisible and initializeRecorder()
will be called in onVisibilityChanged(). That will cause exception
if surface holder is still null.
bug
2319111
releaseMediaRecorder();
mPreferences.registerOnSharedPreferenceChangeListener(this);
} else {
- initializeRecorder();
+ // When mSetting is set to invisible in onPause, we should not
+ // initialize recorder.
+ if (!mPausing) initializeRecorder();
mPreferences.unregisterOnSharedPreferenceChangeListener(this);
}
}