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