首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

Android中 判断是平板仍是手机

2013-10-10 
Android中 判断是平板还是手机//是平板返回true 不是平板返回falsepublicboolean isTablet(Context contex

Android中 判断是平板还是手机

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

public  boolean isTablet(Context context) {

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

 }

热点排行