title: Understanding of the start and stop of a game in Android
body: <p>I'm developing a videogame in Android. For it, I'm using a game loop and all the typical stuff it envolves. I have a doubt about the states of the activity in android.</p>
  
  <p>I need an activity to create the GLSurfaceView and so, the problem is the activity, when it finishes its onCreate method, continues this way: onCreate -> onResume -> onStart -> onStop.
  I guess it goes throught those states because the activity doesn't have anything to do and it's the loop who is working. But I have a problem with this behaviour:</p>
  
  <p>How can I know when the user "minimize" or put the device in a stand by state? Again, the methods onStop -> onResume -> onStart will trigger, but, how can I difference this time with the first?</p>
  
  <p>I need to stop the loop when the user switch the device to stand by, but not when it starts the first time.</p>
  
  <p>I hope I have explained well. Thanks.</p>