Issue
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.
Answered By - dinhlam
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.