Programmatically obtain the phone number of the Android phone

后端 未结 18 2004
南笙
南笙 2020-11-21 06:17

How can I programmatically get the phone number of the device that is running my android app?

18条回答
  •  深忆病人
    2020-11-21 06:54

    TelephonyManager is not the right solution, because in some cases the number is not stored in the SIM. I suggest that you should use the shared preference to store the user's phone number for the first time the application is open and the number will used whenever you need.

提交回复
热议问题