6

My code is here, it is always throwing null

TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); 
String number = tm.getLine1Number();

I used the permission

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

Please give me exact solution to get phone number. Thank you.

Gangadhar Nimballi
  • 1,534
  • 3
  • 18
  • 46
  • 1
    duplicate of [get associated Phone number with SIM](http://stackoverflow.com/questions/5515361/get-associated-phone-number-with-sim) and https://stackoverflow.com/questions/17705403/retrieving-phone-number-from-sim-card-error and others – CommonsWare Mar 28 '14 at 10:36

0 Answers0