Activity
は、私が(でframeLayoutを使用して)Video Player
に50%のスペースを割り当てられ、ListView
に50%を休ましているLandscape
モードonBackPressed()オリエンテーション問題
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:screenOrientation="landscape"
android:label="@string/app_name" >
をサポートしています。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/video_frame"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<ListView
android:id="@+id/video_list_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
は今、私は(一方>はポートレートモードでフルスクリーンにモード>なって活動を終了するに押し戻さフルスクリーンモード>に移動し、ビデオを再生しを開始しました私は風景モードでそれを得ることを期待してでした
boolean isFullScreen = false;
@Override
public void onGoToFullscreen() {
isFullScreen = true;
videoListView.setVisibility(View.INVISIBLE);
}
@Override
public void onReturnFromFullscreen() {
videoListView.setVisibility(View.VISIBLE);
}
@Override
public void onBackPressed() {
Log.d("boolean:-", Boolean.toString(isFullScreen));
if(isFullScreen) {
imaPlayer.getContentPlayer().setFullscreen(false);
}
else {
super.onBackPressed();
}
}
http://stackoverflow.com/a/11310902/3790150 – saeed