NiethanX NiethanX - 28 days ago 9
Android Question

Android - Enabling and Disabling Send Email Button

In my application, there is a button that connects the app to mail applications for sending an email. I'm trying to disable the button after clicking one time but I couldn't understand where should I enable the button again which causes no problem. Here is my code:

tvAboutEmail.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
"mailto","something@gmail.com", null));
startActivity(Intent.createChooser(emailIntent, "Sending With:"));
}
});

Answer Source

You can enable the button on method onResume on your activity. Or you can create a thread that enable the button after n seconds. But this business logic decision that you have to make.