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中获取自己的手机号码
如何在 GSM 手机中获取与 SIM 关联的电话号码?
尝试以下代码
TelephonyManager tMgr=(TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE); mPhoneNumber = tMgr.getLine1Number();
并在您的 xml 中获得以下许可
READ_PHONE_STATE