getLine1Number return null but not always [duplicate]

a 夏天 提交于 2019-12-04 01:56:20

问题


I use the TelephonyManager to get the phone number, in the SDK all works perfectly, on some devices like my hero with 1.5 it returns null, on the tattoo with 1.6 it works but on some other tattoos it returns null.
Is there any other way to get the phone number?


回答1:


As far as I know, the phone number returned is whatever is stored on the SIM card's MSISDN, which isn't filled by some operators. (Worse still, according to some reports, the number might actually be incorrect!)

Unfortunately, I don't know of any other method, either.




回答2:


I searched a lot for this problem and didn't find any solution. There is a solution of reading SMS or sending SMS from some server.




回答3:


The solution is to put the SIM card in a dumb phone (or any Blackberry pre-2009) and the MSISDN will be set. I think with Blackberries you can manually set them.

Try dial ##000000 with the radio off and edit the first line in the menu that shows up on the Blackberry.



来源:https://stackoverflow.com/questions/2443524/getline1number-return-null-but-not-always

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!