Mehmet Ethem SULAN :: Android :: Android Screen Orientation and Full Screen Mode

VideoView full screen yapmak için AndroidManifest.xml de full screen ve oryentasyonu yatay yapılması gerekiyor. Yani video açıldığında yatay ve full screen olmak için aşğıdaki kodu yazmamız gerekiyor. Uygulamada TextView kullandım.

        <activity android:name=".FullScreenActivity"
                  android:label="@string/app_name"
                  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
                  android:screenOrientation="landscape" >

orientations


themes
Output

full mode

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.orientation.screen"
      android:versionCode="1"
      android:versionName="1.0">

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".FullScreenActivity"
                  android:label="@string/app_name"
                  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
                  android:screenOrientation="landscape">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>

FullScreenActivity.java

package com.orientation.screen;

import android.app.Activity;
import android.os.Bundle;

public class FullScreenActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hello"
    />
</LinearLayout>
Bu TextView yerine VideoView kullanmak gerekir.

Download OrientationFullScreen.tar.gz

Write a Comment

Let me know what you think?