首页 > 代码库 > [Android Tips] 13. How to Detect Tablet

[Android Tips] 13. How to Detect Tablet

/**  * 判断是否是平板  * @param context  * @return  */public static boolean isTablet(Context context) {    return (context.getResources().getConfiguration().screenLayout                & Configuration.SCREENLAYOUT_SIZE_MASK)                >= Configuration.SCREENLAYOUT_SIZE_LARGE;}

Ref

 

  • Android中如何判断是手机还是平板
  • ANDROID 应用如何判断是否是平板

 

[Android Tips] 13. How to Detect Tablet