0

Possible Duplicate:
How to fetch own mobile number in android

How to get the telephone number associated with the SIM in a GSM phone?

Community
  • 1
  • 1
Geltrude
  • 1,093
  • 3
  • 17
  • 35

1 Answers1

2

try following code

TelephonyManager tMgr=(TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE);
mPhoneNumber = tMgr.getLine1Number();

and with following permission in your xml

READ_PHONE_STATE
ingsaurabh
  • 15,249
  • 7
  • 52
  • 81