Im displaying contact details on a screen. I need to display phone call window to appear when user clicks on phone number in the contact details.
Please let me know How i can do this
Thanks in advance
At it's most basic form, click-to-call technology works by the end user enters her phone number and requests a call. An intermediary service then dials the end user and other third party and initiates a conversation between the two parties.
You can simply add an onclick handler to your <tr> tag, then call window. open("tel:+1800229933"); .
I find answer
<TextView android:text="888-468-0602"
android:autoLink="phone" />
use this code
String number = "9423012345";
txt.setTag(number);
txt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+(String) v.getTag()));
callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(callIntent);
}});
And add this line to your manifest file
uses-permission android:name="android.permission.CALL_PHONE"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With