How to prevent the activity from loading twice on pressing the button

后端 未结 19 1937
情深已故
情深已故 2020-12-01 00:15

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

相关标签:
19条回答
  • 2020-12-01 00:42

    It was only working for me when startActivity(intent)

    intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    
    0 讨论(0)
提交回复
热议问题