开发者

orientation change in landscape mode

my code is below but not call this method when screen orientation changed .

public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig
            Intent in=new Intent("com.world.delailsActivity")
                          startActivity(in)
}

and mainfest.xml file is

<application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".WorldCup" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER"
                    android:configChanges="keyboardHidden|orientation" />
            </intent-filter>
        </activity>
        <activity android:name=".Score开发者_JAVA百科Activity" android:label="@string/app_name"
            android:configChanges="keyboardHidden|orientation" >
            <intent-filter>
                <action android:name="com.worldcup.ScoreActivity" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>


In your first Activity, your android:configChanges attribute should be in your activity element, not category.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜