I am very new to Android Studio and am having trouble sending an email from my app. I have the following code pertaining to the default FloatingActionButton that Android Studio generates when creating a blank page. When I click the fab, I get an error that says "Unsupported Action, That action is currently not supported". How can I check what's going on (printing statements and such) and what does this error really mean? I've looked at other peoples' problems related to this one but nothing in the comments have fixed this error for me. Thanks in advance for any help!
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//send email here
String[] addresses = {email};
Intent mailIntent = new Intent(Intent.ACTION_SENDTO);
mailIntent.setType("text/plain");
mailIntent.setData(Uri.parse("mailto:"));
mailIntent.putExtra(Intent.EXTRA_EMAIL, addresses);
mailIntent.putExtra(Intent.EXTRA_SUBJECT, "Feedback request");
mailIntent.putExtra(Intent.EXTRA_TEXT, "Please give me some feedback or say hi");
try {
startActivity(mailIntent);
} catch (android.content.ActivityNotFoundException ex){
Toast.makeText(MainActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
}
});