I have an information popup which has 2 buttons : Negative (Cancel) and Positive (Continue). How can i disable the positive button after a click. The Click on the button generates a file. It calls a function that is quite heavy, so it takes time to close the popup. I am doing this to prevent the user to click twice and thus generate two files.
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(R.string.close_tour_tour_not_collected);
builder.setItems(items, null);
builder.setPositiveButton(R.string.common_continue, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0,
int arg1) {
// How to disable the button after the click???
saveTourAndCloseActivity();
}
});
Thanks a lot for your help! :)