开发者

how to get the telephone number in real device

开发者 https://www.devze.com 2023-01-07 16:21 出处:网络
i want to know get the number of device by telephoneManager and getLine1Number() ,it is 开发者_C百科workly well in analog machine,but in real device i donot get,could you tell me why?

i want to know get the number of device by telephoneManager and getLine1Number() ,it is 开发者_C百科workly well in analog machine,but in real device i donot get,could you tell me why?

in the com.android.internal.telephony inlude getLine1Number() ,how can use the inner class?


This question has been asked and answered on SO a number of times. The phone number is (possibly) stored on the SIM-card and you can get it with TelephonyManager.getLine1Number() however, it is not reliable. Some SIM cards don't have the phone number on them (in which case you will get null) and if the user changes his phone number without swapping his SIM card then you will get his old phone number.

0

精彩评论

暂无评论...
验证码 换一张
取 消