Implicit intent

b2.setOnClickListener(View.OnClickListener {

        var mail:String= et1.text.toString();
        val i = Intent(Intent.ACTION_SENDTO);
        i.data=Uri.parse("mailto"+mail)
        i.putExtra(Intent.EXTRA_SUBJECT,"SUBJECT IS HERE")
        i.putExtra(Intent.EXTRA_TEXT,"HELLO WORLD ")
        startActivity(i);
        //(by using chooser it tells me that no app can perform this action)//startActivity(Intent.createChooser(i,"send mail to ......"))

    })

getting error when i am using the same code as sir …in this video

Here you are passing the Intent action as parameter.

  val i = Intent().apply {
    action = Intent.ACTION_SENDTO
    data = Uri.parse("mailto:$email")
    putExtra(Intent.EXTRA_SUBJECT,"SUBJECT IS HERE")
    putExtra(Intent.EXTRA_TEXT,"HELLO WORLD")
  }
  startActivity(i)

Do this instead

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.