开发者

Set ORIENTATION_LANDSCAPE not working Android

开发者 https://www.devze.com 2022-12-17 14:06 出处:网络
@Override public void onConfigurationChanged(Configuration _newConfig) { if (_newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
    @Override
public void onConfigurationChanged(Configuration _newConfig) {

    if (_newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
        Toast toast = Toast.makeText(this, "test orientation_landscape",
                Toast.LENGTH_LONG);
        toast.show();
        setContentView(R.layout.proceed);
    }

    if (_newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
        Toast toast = Toast.makeText(this, "test orientation_portrait",
 开发者_StackOverflow社区               Toast.LENGTH_LONG);
        toast.show();
        setContentView(R.layout.proceed);
    }

    super.onConfigurationChanged(_newConfig);
}

when i change the emulator orientation, the toast is not shown...? SDK 1.6

i have set the android manifest config -> orientation

When the emulator is changed from portrait to landscape, no effect is shown, but from landscape to portrait, works fine.

If there is any method by which i can keep my app display intact, without any orientation change, when the device is changed in orientation, please let me know that also.

Advanced Thanks for help.

0

精彩评论

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