private String getPhoneNum(){
//与手机建立连接
TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String phoneId = tm.getLine1Number(); //获取手机号码
Log.i(phoneId,phoneId);
return phoneId;
}
android获取手机号
时间: 2024-10-13 21:31:17