开发者

orientation change in landscape mode

开发者 https://www.devze.com 2023-02-05 09:43 出处:网络
my code is below but not call this method when screen orientation changed . public void onConfigurationChanged(Configuration newConfig) {

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

精彩评论

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

关注公众号