 <p>The first thing to point out is that there is nothing like racing condition. The right terminology is just <strong>race condition</strong>. Keep this in mind for the future ;-)</p> <p>I suppose you are using a BroadcastReceiver to receive messages and that you have created the object and tell it to run in a separate thread because of the animation. This means that your showFab method can be called twice in one time. To handle this, define the method as <a href="https://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html" rel="nofollow">synchronized</a>.</p>