Afraid not, its dependent on the carrier whether the MSISDN (Phone number) is visible, so on some SIM cards your code will actually work but on most it probably won't.
On Tue, Jan 17, 2012 at 11:23 AM, Live Happy <[email protected]> wrote: > i want to take the phone number from the phone dialer to use it in my > application for that i used this code in the manifest file > > <uses-permission > android:name="android.permission.READ_PHONE_STATE" /> > > <intent-filter > > > <action android:name="android.intent.action.CALL" /> > > <action android:name="android.intent.action.CALL_PRIVILEGED" / > > > > <category android:name="android.intent.category.DEFAULT" /> > <data android:scheme="tel" /> > > > > and to get the phone number that i call , so i did use this method > > TelephonyManager phoneManager = (TelephonyManager) > > getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); > String phoneNumber = phoneManager.getLine1Number(); > > but its return null when no sim card and nothing when its included > > so is there any other method to get the phone number that i use into > my application > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

