How to prevent repeating actions on double click on the button?
问题 Here are my actions in onClick(). The problem is that if I press the button twice, the new activity will be opened twice. I tried to use setEnabled() and setClickable(), but it does not work. It still shows more then one activity button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(getActivity(), CalendarActivity.class); intent.putExtra("day", 16); intent.putExtra("month", 12); intent.putExtra("year", 1996);