如何让在真实设备的电话号码 [英] how to get the telephone number in real device
问题描述
我想知道度日telephoneManager和getLine1Number()设备的数量,这是很好workly模拟机,但在实际的设备我得到DONOT,你能告诉我为什么吗?
i want to know get the number of device by telephoneManager and getLine1Number() ,it is workly well in analog machine,but in real device i donot get,could you tell me why?
在com.android.internal.telephony inlude getLine1Number(),如何使用内部类?
in the com.android.internal.telephony inlude getLine1Number() ,how can use the inner class?
推荐答案
这个问题已经被问和回答了SO多次。电话号码是(可能)存储在SIM卡上,您可以用得到它TelephonyManager.getLine1Number()
但是,它是不可靠的。有些SIM卡不具有对他们的电话号码(在这种情况下,你将获得空
),如果用户不换他的SIM卡,然后改变了他的电话号码,你会得到他的旧电话号码。
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.
这篇关于如何让在真实设备的电话号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!