Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android configChange:orientation and manifest does not work

Tags:

android

I have used a Web view. which loads webpage. When i orientation is changed it reloads. I want to stop reloading. I did following change in manifest XML File. It works in android 2.2 but not in android 4.0. I am a beginner can any one provide solution.

My Manifest.xml is;

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="application.eag"
    android:versionCode="1"
    android:versionName="1.0" >
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main"
            android:configChanges="orientation|screenSize|keyboardHidden">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
like image 817
manojmore Avatar asked Jul 03 '13 10:07

manojmore


1 Answers

<activity
    android:name=".ActivityName"
    android:configChanges="orientation|screenSize|keyboardHidden"/>

Use screenSize for newly version. orientation might not be supported in some version, need to use screenSize for configChanges

like image 155
Avadhani Y Avatar answered Nov 15 '22 10:11

Avadhani Y