title: OnClick button event triggered during loading after onResume
body: <p>I got a weird problem with one of my Android app.
  I will explain myself :</p>
  
  <ul>
  <li><p>I have a SplashScreen (sort of) which is an activity. Basically, it stays 1 second and after this time a handler is called. This handler launches my <code>HomeActivity</code>, which extends <code>RoboActivity</code> (Roboguice API).</p></li>
  <li><p>During this launch, I see in my stack trace that Roboguice is initializing, and my class too. So it takes 1-2 seconds more to launch the <code>HomeActivity</code> (after the 1 second wait of the SplashScreen).</p></li>
  <li><p>So basically, this is here that I got a problem. During this 1-2 seconds of loading, the SplashScreen is the one showing in front, and the <code>HomeActivity</code> only appears after this 2 seconds. If the user clicks, during these seconds, on the screen, it will be the <code>HomeActivity</code> that will trigger the event. It means that if you click on the SplashScreen, and you wait, when the <code>HomeActivity</code> will show, you will hear a click sound and the button, located where the user clicked, will trigger.</p></li>
  </ul>
  
  <p>I find it very disturbing for the user. So, at the moment, I tried to :</p>
  
  <ul>
  <li><p>Deactivate the buttons in the xml layout by adding </p>
  
  <pre><code>            android:enabled="false"
              android:clickable="false"
  </code></pre></li>
  <li><p>Reactivate the buttons by adding in the onResume function :</p>
  
  <pre><code>button.setEnabled(true);
  button.setClickable(true);
  </code></pre></li>
  <li><p>I see in the stacktrace that the <code>OnClickListener</code> is triggered just after the <code>onResume</code>. So at this moment, the buttons are re-enabled and so it clicks. I tried with postOnResume too, it doesn't work either.</p></li>
  </ul>
  
  <p>Did you experienced the same behavior that I have now ?
  Any idea how to fix it ?</p>