title: OnRestart vs. OnResume - Android Lifecycle Question
body: <p>My end-goal is to have an application that runs a block of code when it (the application, not the activity) is opened up after being left ( back from home screen, etc... )</p>
  <p>According to the Activity Lifecycle, this should be the <code>onRestart()</code> event on a per activity basis ( at least how I interpret it )</p>
  <p>Both <code>onRestart()</code> and <code>onResume()</code> are being called whether I am returning to the Activity within the application (back button) AND when the app is called back up.</p>
  <p>Given this diagram
  <img src="https://i.stack.imgur.com/kTfQV.png" alt="enter image description here" /></p>
  <p>I am interpreting it this way:</p>
  <ul>
  <li><strong>RED</strong> = movement between activities within the application</li>
  <li><strong>BLUE</strong> = moving to an activity outside the Application</li>
  </ul>
  <p>Is my understanding incorrect?</p>
  <p><strong>EDIT</strong> (Clarifying specific use case)</p>
  <p>I'm attempting to use onRestart() to replicate some security logic (PIN Validation) found in onCreate(), but it's being called even when I press the back button inside the application...</p>