Search code examples
androidandroid-intentandroid-dialer

Android: How to show a list of dialer app installed on my device instead of directly calling default dialer


Android: How to show a list of dialer app installed on my device instead of directly calling default dialer

Intent intent = new Intent(Intent.ACTION_CALL);
startActivity(intent); 

permission -

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

So with this code the deault dialer app gets called. I want the behavior where Android suggest me the list of apps that could be used for calling feature.


Solution

  • You can not show list of dialer while using ACTION_CALL intent.

    You need a special permission because the ACTION_CALL is a protected action, allow you to call a phone number directly, with no interaction from the user.

    You can make Intent chooser for ACTION_DIAL intent which allows you to show list of apps which has dialer. You can use this code.

    final Intent intent = new Intent();
    intent.setAction(Intent.ACTION_DIAL);
    intent.setData(Uri.fromParts("tel", "123456", null));
    startActivity(Intent.createChooser(intent, ""), REQUEST_CODE));
    

    I hope it helps!