Set ORIENTATION_LANDSCAPE not working Android

    @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",
                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.


Asked by: Abigail202 | Posted: 25-01-2022






Similar questions





Still can't find your answer? Check out these communities...



Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android



top