0 votes
75 views
in android by (0 points)
closed by
You want to open the default Dialer app on a device. What is wrong with this code?
val dialerIntent = Intent()
val et = findViewById(R.id.some_edit_text)
dialerIntent.action = Intent.ACTION_DIAL
dialerIntent.data = Uri.parse("tel:" + et.getText()?.toString())
startActivity(dialerIntent)

a. startActivityWithResult() should be used instead of startActivity() when using Intent.ACTION_DIAL.
b. For Intent.ACTION_DIAL, the Intent option Intent.FLAG_ACTIVITY_NEW_TASK must be added when using this dialerIntent.
c. The dialerIntent will cause an ActivityNotFoundException to be thrown on devices that do not support Intent.ACTION_DIAL.
d. The permission android.permission.CALL_PHONE must be requested first before Intent.ACTION_DIAL can be used.
closed

1 Answer

0 votes
by (0 points)
 
Best answer
a

2.8k questions

2.8k answers

0 comments

76 users

Welcome to MCQ Village Q&A, where you can ask questions and receive answers from other members of the community.
...