title: How do I kill an Activity when the Back button is pressed?
body: <p>I got an Activity that when it starts, it loads an image from the internet. In an effort to save memory, when the Activity is left by the back button being pressed, I want the activity to dump all data, that is get rid of all the strings and images that are in it. I figured the best way to do this was to just kill the activity. </p>
  
  <p>Well, I can't seem to figure out the callback for when the Back button is pressed. So, I have been trying to use the <code>onPause()</code> and the <code>onStop()</code> callbacks for the task but both ways force close my app. Here is the code:</p>
  
  <pre><code>public void onPause() {
      this.finish();
  }
  public void onStop() {
      finish();
  }
  </code></pre>
  
  <p>I've tried multiple variations of this, but none of them seemed to work. Any ideas? </p>