Skip to content Skip to sidebar Skip to footer

How To Open Dialer On Phone With A Selected Number In Android

I have made an application that uses Google Places API. Once I click on a place it returns the name of the company, the address and the number to the MainActivity. When I click on

Solution 1:

Try This

String phone = mNumber.getText().toString();
Intent phoneIntent = new Intent(Intent.ACTION_DIAL, Uri.fromParts(
"tel", phone, null));
startActivity(phoneIntent);

Solution 2:

Try this.

String number = "494498498";
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:" +number));
startActivity(intent);

Post a Comment for "How To Open Dialer On Phone With A Selected Number In Android"