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