Code example for FragmentActivity

Methods: getWindow, onConfigurationChanged

0
		mVideoView.pause();
	} 
 
	@Override 
	public void onConfigurationChanged(Configuration newConfig) {
		super.onConfigurationChanged(newConfig);
		adjustForOrientation(newConfig);
 
		getWindow().getDecorView().requestLayout(); 
	} 
 
	private void adjustForOrientation(Configuration newConfig){
		if (Configuration.ORIENTATION_PORTRAIT == newConfig.orientation){
			mDescriptionView.setVisibility(View.VISIBLE);
			mTitleView.setVisibility(View.VISIBLE);
			mHandler.removeMessages(HIDE_TITLE);
		}else{ 
			mDescriptionView.setVisibility(View.INVISIBLE);
			if (mVideoView.isPlaying()){
				hideTitleNow(); 
			}