android 如何判断是不是平板

1 public static boolean isTablet(Context context) {
2        return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
3     }
 1 public boolean isTabletDevice() {
 2         TelephonyManager telephony = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
 3         int type = telephony.getPhoneType();
 4         if (type == TelephonyManager.PHONE_TYPE_NONE) {
 5             Log.i("is Tablet!");
 6         } else {
 7             Log.i("is phone!");
 8         }
 9         return false;
10     }
原文地址:https://www.cnblogs.com/androidxiaoyang/p/2960754.html