简体   繁体   中英

Android app accessing the android dialer

Is it possible to access the dialer of android (mobile phone) from android app. Say if a user enters 001 in the app following by a telephone number, app should make the dialer of android(Mobile Phone) dial the number after 001...?

You can send an Intent which will open de phone dialer with supplied phonenumber.

http://developer.android.com/reference/android/content/Intent.html#ACTION_DIAL

String url = "tel:1234";
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));

Don't forget to add the permission to your manifest

<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>

You could try to send Intent with this action Intent.ACTION_DIAL(android.intent.action.DIAL) to see if it works. ACTION_DIAL tel:123 -- Display the phone dialler with the given number filled in.

Use below code hope it helps

Intent sIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:"+00189899989));
startActivity(sIntent);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM