title: Get telephone number of device
body: <p>I am making an app in which I have to get the mobile number of the GSM device and I used the following code to show to phone no in a TextView, but all in vain. Can anyone help me do this.</p>
  
  <pre><code>TelephonyManager mTelephonyMgr;
      mTelephonyMgr = (TelephonyManager)
          getSystemService(Context.TELEPHONY_SERVICE);
  
      String number = mTelephonyMgr.getLine1Number();
  
      Phoneno=(TextView)findViewById(R.id.Phoneno);
  
  
      Phoneno.setText(number);
  </code></pre>