I am trying to prevent the activity from loading twice if I press the button twice instantly after the first click.
I have an activity which loads on click of a butt
Use a flag variable set it to true, Check if its true just return else perform Activity Call.
flag
to true
return
You can also use setClickable(false) one executing the Activity Call
flg=false public void onClick(View view) { if(flg==true) return; else { flg=true; // perform click} }