现在的位置: 首页 > 移动开发 > 正文

Android中 判断是平板还是手机

2018年09月18日 移动开发 ⁄ 共 204字 ⁄ 字号 评论关闭

//是平板返回true 不是平板返回false

public  boolean isTablet(Context context) {

  return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;

 }

抱歉!评论已关闭.