0

I'm pretty confused as to why this is. When I close and open my app on my phone without killing the process, it reopens as if it was never open to begin with. If I continue to use the app that was sent via USB debugging after disconnecting the cable, it works fine. If I grab the APK from the bin folder and install that, it will break.

This is my code for saving my variables in the onSaveInstanceState method:

super.onSaveInstanceState(outState);
outState.putParcelableArrayList(PAIRS, pairs);
outState.putStringArrayList(PLAYERS, players);
outState.putParcelableArray(TEAMS_IN, teamsIn);
outState.putSerializable(GAMES_OUT, gamesOut);
outState.putStringArrayList(CURRENTLY_PLAYING, currentlyPlaying);       

And this is the code that runs in onCreate if savedInstanceState != null:

pairs = savedInstanceState.getParcelableArrayList(PAIRS); //TODO: look into type
players = savedInstanceState.getStringArrayList(PLAYERS);
teamsIn = (Team[]) savedInstanceState.getParcelableArray(TEAMS_IN);
gamesOut = (HashMap<String, Integer>) savedInstanceState.getSerializable(GAMES_OUT); 
currentlyPlaying = (ArrayList<String>) savedInstanceState.getStringArrayList(CURRENTLY_PLAYING);

What could possibly be causing this?

Richard Le Mesurier
  • 29,432
  • 22
  • 140
  • 255
SaxSalute
  • 349
  • 2
  • 8
  • 1
    What exactly happens when you resume the app when not plugged in? As an error thrown (if this is the case please include stacktrace) or is it simply left in an inconsistent state? – Kent Hawkings Mar 03 '14 at 16:11
  • It just reopens as if it was never opened to begin with. No error or anything. – SaxSalute Mar 03 '14 at 16:22
  • "As if it was never opened to begin with" is not really a problem statement we can work with. What *specifically* does not operate as intended? – Chris Stratton Mar 03 '14 at 17:51

0 Answers0