如何获得在Android的code手机的电话号码吗?如何获得、电话号码、手机、code

2023-09-04 23:11:16 作者:本王不死,尔等终是臣

我试着在谷歌上搜索谷歌,但找不到答案

I tried googling in google but unable to find the answer

请问有人请让我知道,我怎么可以检索从Android code当前的电话号码。我认为电话号码将被存储在SIM卡

Will anyone please let me know, how can i retrieve the current phone number from the android code. I think phone number will be stored in the sim card.

感谢和放大器;问候, SSuman185

Thanks & Regards, SSuman185

推荐答案

您可以试试:

TelephonyManager phoneManager = (TelephonyManager) 
    getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
String phoneNumber = phoneManager.getLine1Number();

需求 READ_PHONE_STATE 许可。