Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
用户安装我的android应用程序后,如何自动获取手机号码。在我的应用程序中注册时无需手动输入。我正在使用以下代码。
TelephonyManager manager =(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String phoneNumber = manager.getLine1Number();
确保您在清单中拥有 READ_PHONE_STATE 权限
也请在这里查看更多信息!