2014.04.21 ——— android 魅族SmartBar判断

2014.04.21 ——— android 魅族SmartBar判断

public boolean hasSmartBar() {
		try {
			// 新型号可用反射调用Build.hasSmartBar()
			Method method = Class.forName("android.os.Build").getMethod(
					"hasSmartBar");
			return ((Boolean) method.invoke(null)).booleanValue();
		} catch (Exception e) {
		}
		// 反射不到Build.hasSmartBar(),则用Build.DEVICE判断
		if (Build.DEVICE.equals("mx2")) {
			return true;
		}
		return false;
	}










猜你喜欢

转载自trylovecatch.iteye.com/blog/2050349