TelephonyManager不上的每个设备提供了电话号码 [英] TelephonyManager is not Providing Phone Number on Every Device
问题描述
我需要的电话号码在开发我的申请。所以,我用 TelephonyManager
,如下图所示:
I need phone numbers while developing my application. So, I used TelephonyManager
as seen below:
TelephonyManager tmgr =(TelephonyManager)getApplicationContext().getSystemService(getApplicationContext().TELEPHONY_SERVICE);
Log.d("Tag", tmgr.getLine1Number());
但是,当我尝试在不同的设备上的应用程序,不知何故 getLine1Number()
不工作。我的意思是返回 NULL
。
But when I tried application in different devices, somehow getLine1Number()
not working. I mean returns NULL
.
权限是好的。最后,确实 getLine1Number()
依赖于其他的要求?是否有可能为学习手机每台设备上的数字。
Permission is okay. Finally, does getLine1Number()
depend on other requirements? Is it possible to learn phone number on every device.
感谢您的建议。
推荐答案
这是不可能让每一个设备上的电话号码,因为这取决于如何sim卡而成。这是SIM卡的限制。
it is not possible to get phone number on every device because this depends on how sim card is made. This is a sim card limitation.
这篇关于TelephonyManager不上的每个设备提供了电话号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!