当前位置: 代码迷 >> Android >> Android中 判断是平板仍是手机
  详细解决方案

Android中 判断是平板仍是手机

热度:99   发布时间:2016-04-28 07:50:39.0
Android中 判断是平板还是手机

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

public  boolean isTablet(Context context) {

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

 }

  相关解决方案