[android-developers] Re: TelephonyManager.getLine1Number() returns null always
Seems line a (lack of) permission problem. For GSM, the phone number
is on the SIM card, and some carriers just don't put it on the card,
and then the phone does not know what it is, but in this case you
should get an empry string rather than a null.
On Jan 2, 3:18 am, Kristopher Micinski <krismicin...@gmail.com> wrote:
> Some devices just do this,
>
> what device are you using?
>
> Also, you should have the read phone state permission for this, though
> if you didn't have it the result should be a security exception rather
> than this null behavior (unless I'm forgetting that the api silently
> checks for the permission, however, I think this is not the case...)
>
> kris
>
> On Mon, Jan 2, 2012 at 6:13 AM, Upendra Reddy Vuyyuru<upendraredd...@gmail.com> wrote:
> > Hi All,
>
> > I am trying to fetch the telephone number of the device. I am calling
>
> > TelephonyManager.getLine1Number() it always returns null.
>
> > Thank you in advance....
>
> > Regards
> > Upendra Reddy.V
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscribe@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home