0
如何使用以下代碼打開橫向中的所有視頻?我希望所有視頻在橫向打開,然後根據設備的方向從最後位置旋轉來改變方向。如何在橫向上打開所有視頻?
Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "video/mp4");
startActivity(intent);
如何使用以下代碼打開橫向中的所有視頻?我希望所有視頻在橫向打開,然後根據設備的方向從最後位置旋轉來改變方向。如何在橫向上打開所有視頻?
Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "video/mp4");
startActivity(intent);
android:screenOrientation="landscape"
Set This Property In Your Manifest File On your Particular activity.
E.g-
<activity android:name=".MainActivity"
android:screenOrientation="landscape"></activity>
使用這個代碼
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);