转载自:http://www.cnblogs.com/sunzn/p/3663363.html
1 /** 2 * 判断当前设备是手机还是平板,代码来自 Google I/O App for Android 3 * @param context 4 * @return 平板返回 True,手机返回 False 5 */ 6 public static boolean isTablet(Context context) { 7 return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE; 8 }