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.