is Portrait via Context - Android android.content

Android examples for android.content:Context

Description

is Portrait via Context

Demo Code

import android.content.Context;
import android.content.res.Configuration;

public class Main {

  public static boolean isPortrait(Context context) {
    return (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT);
  }/* w w w. j a v  a  2  s.c  om*/

}

Related Tutorials