In android how to get phone number of caller (i mean our own phone no)? [closed]
**
how to get phone no of caller (i mean our own phone no)?
**I got the reciever phone number but not getting caller phone no开发者_如何学Go.If any idea please tell me?
Take a look at
How to get the phone number of the phone in android code?
and
How to get phone number of an android CDMA phone?
to get ur phone no following code is used
final Context context = getApplicationContext();
TelephonyManager tMgr = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
String mPhoneNumber = tMgr.getLine1Number();
and add uses-permission for
android.permission.READ_PHONE_STATE
in androidmanifest.xml
精彩评论