title: How to prevent an activity from being initialized multiple times
body: <p>I have an Android app, when a user taps a button multiple times quickly, same activity is initialized multiple times.</p>
  
  <p>To prevent this, I added <code>android:launchMode="singleInstance"</code> in Manifest file. But now, when an activity calls itself, it doesn't work.</p>
  
  <p>I also tried </p>
  
  <pre><code>Intent myintent = getIntent();
  myintent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); 
  </code></pre>
  
  <p>But this didn't work either.</p>
  
  <p>How can I prevent having multiple activities when user clicks a button multiple times quickly, and how can I have same activity call itself correctly. Thanks.</p>