title: Main App is killed after launching a streetview activity
body: <p>In my code I start a new activity for street view.</p>
  
  <pre><code>Intent streetView = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
  startActivity(streetView);
  </code></pre>
  
  <p>It Launches the street view just fine. If I don't do much, I can hit the back button and my App is sitting there waiting like nothing had changed.</p>
  
  <p>However, if I use street view for a bit and look around and move the view around, I see this in the logcat:</p>
  
  <p>01-27 10:53:27.526: INFO/ActivityManager(1079): Low Memory: No more background processes.</p>
  
  <p>01-27 10:53:27.636: DEBUG/dalvikvm(32218): GC_FOR_MALLOC freed 3054 objects / 198608 bytes in 655ms</p>
  
  <p>01-27 10:53:27.831: DEBUG/dalvikvm(32164): GC_FOR_MALLOC freed 1054 objects / 51664 bytes in 342ms</p>
  
  <p>01-27 10:53:27.862: INFO/dalvikvm-heap(32164): Grow heap (frag case) to 3.656MB for 87396-byte allocation</p>
  
  <p>01-27 10:53:27.878: INFO/ActivityManager(1079): Process com.favorite.me (pid 32135) has died.</p>
  
  <p>01-27 10:53:27.878: INFO/ActivityManager(1079): Low Memory: No more background processes.</p>
  
  <p>01-27 10:53:27.482: INFO/ActivityManager(1079): Process com.myapp.app (pid 31481) has died.</p>
  
  <p>01-27 10:53:27.490: INFO/WindowManager(1079): WIN DEATH: Window{44c68ba8 com.myapp.app/com.myapp.app.MyLocation paused=false}</p>
  
  <p>Then when I hit the back button to return to my app, it seems like all the variable have been reset to null, like I've lost my app's state. The only way to fix it is to hit the back button again and relaunch that activity.</p>
  
  <p>From what I can tell, its not calling the onpause() or the onSaveInstanceState() methods and the OS is killing off my App for memory to run streetview.</p>
  
  <p>Is there something I need to do differently?</p>
  
  <p>Here is my oncreate, onRestoreInstanceState and onSaveInstanceState methods:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  </code></pre>
  
  <hr>
  
  <pre><code>        @Override
      public void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
          sLong = savedInstanceState.getDouble("sLong");
          sLat = savedInstanceState.getDouble("sLat");
          sMapStyle = savedInstanceState.getBoolean("sMapStyle");
          sMapUpdate = savedInstanceState.getBoolean("sMapUpdate");
          sMapStreet = savedInstanceState.getBoolean("sMapStreet");
          sFirstTime = savedInstanceState.getBoolean("sFirstTime");
          locationAvailable = savedInstanceState.getBoolean("locationAvailable");
          sGPSFlag = savedInstanceState.getBoolean("sGPSFlag");
          sMessage = savedInstanceState.getString("sMessage");
          sMap = savedInstanceState.getString("sMap");
          sGPS = savedInstanceState.getString("sGPS");
          sAddressIn = savedInstanceState.getString("sAddressIn");
          sGPSLat = savedInstanceState.getString("sGPSLat");
          sGPSLong = savedInstanceState.getString("sGPSLong");
      }
  
      @Override
      public void onSaveInstanceState(Bundle savedInstanceState) {
        super.onSaveInstanceState(savedInstanceState);
          savedInstanceState.putDouble("sLong",sLong);
          savedInstanceState.putDouble("sLat",sLat);
          savedInstanceState.putBoolean("sMapStyle",sMapStyle);
          savedInstanceState.putBoolean("sMapUpdate",sMapUpdate);
          savedInstanceState.putBoolean("sMapStreet",sMapStreet);
          savedInstanceState.putBoolean("sFirstTime",sFirstTime);
          savedInstanceState.putBoolean("locationAvailable",locationAvailable);
          savedInstanceState.putBoolean("sGPSFlag",sGPSFlag);
          savedInstanceState.putString("sMessage",sMessage);
          savedInstanceState.putString("sMap",sMap);
          savedInstanceState.putString("sGPS",sGPS);
          savedInstanceState.putString("sAddressIn",sAddressIn);
          savedInstanceState.putString("sGPSLat",sGPSLat);
          savedInstanceState.putString("sGPSLong",sGPSLong);
      }
  </code></pre>
  
  <p>I think I may have a lead on why this is happening. Still not sure how correct it yet.
  I set some debugging messages and I am seeing the <code>onRestoreInstanceState()</code> and <code>onSaveInstanceState()</code> methods run.</p>
  
  <p>The problem is, it is not restoring my saved instance until <em>after</em> my <code>onCreate()</code> method finishes. But it is during the <code>onCreate()</code> method that I am needing these variables which are still null at this point. How can I get my code to run after the <code>onCreate()</code> but without requiring any user input? or How can I get the <code>onRestoreInstanceState()</code> to run before my code?</p>