Programmatically obtain the phone number of the Android phone

后端 未结 18 1705
南笙
南笙 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:36

    Although it's possible to have multiple voicemail accounts, when calling from your own number, carriers route you to voicemail. So, TelephonyManager.getVoiceMailNumber() or TelephonyManager.getCompleteVoiceMailNumber(), depending on the flavor you need.

    Hope this helps.

提交回复
热议问题