당신이 크기 분류를해야 할 경우 - "작은", "보통", "큰", "초대형"- 구성 클래스를 사용하면 다음 방향을 확인해야 할 경우
Configuration config = getResources().getConfiguration();
int size = config.screenLayout & config.SCREENLAYOUT_SIZE_MASK;
if (size == config.SCREENLAYOUT_SIZE_SMALL)
{
// use special layout for small screens
}
은 당신이 할 수있는 사용
public int getScreenOrientation()
{
Display getOrient = getWindowManager().getDefaultDisplay();
int orientation = Configuration.ORIENTATION_UNDEFINED;
if(getOrient.getWidth() == getOrient.getHeight()) {
orientation = Configuration.ORIENTATION_SQUARE;
} else {
if(getOrient.getWidth() < getOrient.getHeight()){
orientation = Configuration.ORIENTATION_PORTRAIT;
} else {
orientation = Configuration.ORIENTATION_LANDSCAPE;
}
}
return orientation;
}
을 사용하면 화면 크기를 확인해야하는 이유는 다른 레이아웃 폴더에서 레이아웃을 추가하는 경우 때문에 정말, 그것을 얻을하지 않습니다, 다음, 안드로이드는 자동으로 화면의 크기에 따라 가장 적합한 선택합니다.
7 인치 태블릿에는 ... 7 인치 태블릿이 있습니다. SCREENLAYOUT_SIZE_XLARGE – evilone
안녕하세요 저는 삼성 갤럭시입니다 ... –
정확히 어떤 모델입니까? – evilone