Possible Duplicate:
How to fetch own mobile number in android
How to get the telephone number associated with the SIM in a GSM phone?
Possible Duplicate:
How to fetch own mobile number in android
How to get the telephone number associated with the SIM in a GSM phone?
try following code
TelephonyManager tMgr=(TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE);
mPhoneNumber = tMgr.getLine1Number();
and with following permission in your xml
READ_PHONE_STATE
null
because it is not mandatory to store the phone number on the SIM. i.e. some operators store it in the SIM and some others not. –
Cutlor © 2022 - 2024 — McMap. All rights reserved.