/**
* 判斷目前裝置是手機還是平闆,代碼來自 Google I/O App for Android
* @param context
* @return 平闆傳回 True,手機傳回 False
*/
public static boolean isTablet(Context context) {
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}
專注移動網際網路産品設計研發 分享最新的移動網際網路産品和技術