This article is described as a common Android code, mainly used to determine whether the phone screen is horizontal or vertical, in the judge screen level or vertical, you can respond to the program, the instance code is only to determine if it is a vertical screen, if the correct return true, otherwise return false.
The specific program code is as follows:
Package com.lurencun.cfuture09.androidkit.util.ui;
Import Android.content.Context;
Import android.content.res.Configuration;
public class Activityutil {
/**
* Returns whether the current screen is a vertical screen.
* @param context
* @return returns False if and only when the current screen is a vertical screen.
*/Public
static Boolean isscreenoriatationportrait (context context) {return
context.getresources (). GetConfiguration (). Orientation = = configuration.orientation_portrait;
}
}