I can't display the contact name while dialing a call in Android.
Here is my code:
String callTo = "9999900000";
String callername="xxx";
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+ callTo));
String srvname=Context.TELEPHONY_SERVICE;
TelephonyManager tm=(TelephonyManager)getSystemService(srvname);
startActivity(callIntent);
For that you need to create a broadcast receiver and in OnReceive method check an
OUTGOING CALL
state and then get caller number from that and then create another method to check whether the contact exists in you mobile or not for that pass that contact number in the method.Below is the code for Caller name broadcastReceiver
to download code visit this link done by Vinod Dirishala