How To Identify Outgoing call Phone Number Through our Application
1. Use BroadcastReceiver.
2. Add Permission to Your Manifest File.
1.Add the following code
public class OutgoingCallReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Bundle bundle = intent.getExtras();
if(null == bundle)
return;
String phonenumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);
Log.i("GetPhoneNumber",phonenumber);
String outgoingNumber = phonenumber;
Toast.makeText(context, outgoingNumber , Toast.LENGTH_LONG).show();
}
}
2.In your Manifest
<receiver android:name=".OutgoingCallReceiver" >
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>
</receiver>
Very informative blog.It is very useful post for android developer and android users as well.
ReplyDeleteandroid application development companies
Thank You AAREN
DeleteThank you
ReplyDeleteVery informative blog of Digital Marketing training
ReplyDeletethank you
Deletethanks for giving information related to android development phone
ReplyDeletethank you
Delete