title: Issue with global variables
body: <p>I defined some global variables in my app by extending Application, as shown below. When I leave the app, open more apps and play a bit with them, and go back to my app, the global variables have been deleted and my app crashes. I've got 2 questions:</p>
  
  <p>1- How can this be possible?</p>
  
  <p>2- How can I force my app to exit when going to background? I know I'm not supposed to do it, but I can't find other solution...</p>
  
  <p>Thanks</p>
  
  <pre><code>public class GlobalVars extends Application { 
  
      public static HashMap&lt;Integer, String&gt; ID2Cat = new HashMap&lt;Integer, String&gt;();
  
      // User logged bool
      public static boolean isLogged = false;
  
      // Current menu item
      public static int currentMenuItem = 0;
      public static boolean isHome = false;
  
      // Goodideas    
      public static JSONObject goodIdeas = new JSONObject();
  
      // Meteo
      public static JSONArray weatherItems = new JSONArray();
  
      // More stuff
  
  }
  </code></pre>
  
  <p><b>Logcat</b></p>
  
  <p>Here's what makes me think my app is killed. This is shown at some point while playing with other apps.</p>
  
  <pre><code>I/ActivityManager( 2465): Process com.mysite.myapp (pid 23538) has died.
  I/WindowManager( 2465): WIN DEATH: Window{4852a678 com.mysite.myapp/com.mysite.myapp.Home paused=false}
  I/WindowManager( 2465): WIN DEATH: Window{485b63a8 com.mysite.myapp/com.mysite.myapp.Home paused=false}
  I/WindowManager( 2465): WIN DEATH: Window{4826fbf8 com.mysite.myapp/com.mysite.myapp.ItemList paused=false}
  I/WindowManager( 2465): WIN DEATH: Window{48286f90 com.mysite.myapp/com.mysite.myapp.ItemDetail paused=false}
  W/GpsLocationProvider( 2465): Unneeded remove listener for uid 1000
  D/GpsLocationProvider( 2465): stopNavigating
  D/gps_BRCM( 2465): [status check] on_stop() : GPS_STATUS_SESSION_END
  D/gps_BRCM( 2465): gps_engine_status_update 2
  D/GpsLocationProvider( 2465): send an intent to notify that the GPS has been enabled or disabled
  D/gps_BRCM( 2465): gps_stop: called
  V/GpsLocationProvider( 2465): hybridGpsSensorDeregister : No registered sensorManager
  D/GpsLocationProvider( 2465): hybridGpsSensorDeregister
  </code></pre>