//是平板返回true 不是平板返回false
public boolean isTablet(Context context) {
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
本文提供了一个简单的方法来判断Android设备是否为平板,通过检查屏幕尺寸来确定。
//是平板返回true 不是平板返回false
public boolean isTablet(Context context) {
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}

被折叠的 条评论
为什么被折叠?