Search code examples
androidandroid-intentintentfilter

Android Intent ACTION_DIAL vs ACTION_VIEW which is better for dialing a number?


Which one is better and why for showing the dial pad with entered number:

  • ACTION_DIAL

  • ACTION_VIEW

     button_action_view.setOnClickListener {
             val intent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:99986037"))
             startActivity(intent)
         }
     button_dial_view.setOnClickListener {
             val intent = Intent(Intent.ACTION_VIEW, Uri.parse("tel:99986037"))
             startActivity(intent)
         }
    

Solution

  • Follow the documentation:

    ACTION_VIEW 123 -> Display the phone dialer with the given number filled in. Note how the VIEW action does what is considered the most reasonable thing for a particular URI.

    ACTION_DIAL 123 -> Display the phone dialer with the given number filled in.

    So ACTION_DIAL is better.