Commit 78abfbf2 authored by Edward Wang's avatar Edward Wang
Browse files

VideoPlayerActivity: avoid NullPointerException

Don't use mAudioManager before it is initialized
parent bc86a5e1
......@@ -254,9 +254,12 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
Log.d(TAG, "MediaRouter information : " + mMediaRouter .toString());
}
mSettings = PreferenceManager.getDefaultSharedPreferences(this);
/* Services and miscellaneous */
mAudioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
mAudioMax = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
mEnableCloneMode = mSettings.getBoolean("enable_clone_mode", false);
createPresentation();
setContentView(mPresentation == null ? R.layout.player : R.layout.player_remote_control);
......@@ -349,10 +352,6 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
mLoadingText = (TextView) findViewById(R.id.player_overlay_loading_text);
startLoadingAnimation();
/* Services and miscellaneous */
mAudioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
mAudioMax = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
mSwitchingView = false;
mEndReached = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment