Find out if Android device is portrait or landscape for normal usage?

You can do this by:

For Lanscape

if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
    // Do some stuff
}

For Portrait

if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
    // Do some stuff
}

Check: Configuration.orientation

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)