判断当前设备是否为手机


public static boolean isPhone(Context context) {
    TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    if (telephony.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE) {
        return false ;
    } else { 
        return true;
    }
}
相关标签

扫一扫

在手机上阅读