判断移动设备是手机还是平板?

/**
 * 判断是否是平板 * 谷歌源码(尺寸,分辨率,能否打电话都是浮云)
 * @param context
 * @return
 */
 public static boolean isTablet(Context context) {
 return (context.getResources().getConfiguration().screenLayout
 & Configuration.SCREENLAYOUT_SIZE_MASK)
 >= Configuration.SCREENLAYOUT_SIZE_LARGE;
 }

猜你喜欢

转载自blog.csdn.net/u011719228/article/details/43339523