title: Android new Intent memory leak / out of memory
body: <p>I've got an app with 2 Activities. The first one launches on startup and with a button launches the second activity using an Intent.</p>
  
  <pre><code>Intent intent = new Intent(MainActivity.this, com.example.project.SomeActivity.class);
  startActivityForResult(intent, 0);
  </code></pre>
  
  <p>In the second activity I have a camera and some memory allocation.</p>
  
  <p>When I press the 'close' button in the second activity, I call Close on the camera and finish on the activity.</p>
  
  <pre><code>    m_camera.Close(CameraEnum.FRONT.getCameraID());
      this.finish();
      System.gc();
  </code></pre>
  
  <p>When I close the activity for the first time and call it back from the first activity all is good, also for the second time - but when I open it in the third time - I get an out of memory error on this line:</p>
  
  <pre><code>m_data = new byte[4*width*height];
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code>05-19 14:22:51.440: E/dalvikvm-heap(31838): Out of memory on a 1228816-byte allocation.
  ...
  05-19 14:42:42.174: E/AndroidRuntime(7345): java.lang.OutOfMemoryError
  </code></pre>
  
  <p>I can find out why this should happen.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks!</p>