次のコードを使用して、すべてのビデオを横向きで開くにはどうすればよいですか? すべてのビデオを横向きで開き、最後の位置からのデバイスの向きの回転に応じて向きを変更します。
Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "video/mp4");
startActivity(intent);
このコードを使用してください
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
android:screenOrientation="landscape"
Set This Property In Your Manifest File On your Particular activity.
E.g-
<activity android:name=".MainActivity"
android:screenOrientation="landscape"></activity>