So, which way is the best option then ?

On Oct 18, 1:45 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> Since getLine1Number() often returns null or an invalidnumber, I
> suggest that you stopusingit entirely.
>
>
>
>
>
>
>
>
>
> On Mon, Oct 17, 2011 at 3:54AM, DroidMaster <lyseng.ta...@gmail.com> wrote:
> > IamusingfollowingAPItogetaphonenumber;however,someof the
> >devicewillreturnthenumberinfollowingformat:
>
> > "+" + countrycode +phonenumberEx. +12062436969
>
> > TelephonyManager tm = (TelephonyManager)
> > getSystemService(TELEPHONY_SERVICE);
> > String phoneNumber = tm.getLine1Number();
> > I would like to find out a way/algorithm to remove this "+" sign and
> > the country code, so Iwillgetonly the last ten digits. Ex.
> > +12062436969 -> 2062436969
>
> > I believe I only need the last ten digits. could anyone please suggest
> > any idea?
>
> > --
> > 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+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 4.0 Available!

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to