[android-developers] savedInstanceState null?

2011-01-20 Thread Chris
Hi All,

I'm trying to save the state of my app while I shut it down but every
time I bring it back up savedInstanceState is always null..? I
couldn't seem to find much info on calling onSaveInstanceState
properly so here's what I did

onPause ()
{...
  Bundle test = new Bundle();
  this.onSaveInstanceState(test);
}
onSaveInstance(Bundle save)
{
  save.putBoolean(Run, true); // testing
  super.onSaveInstanceState(save);
}

I'd rather use this method than writing to a file or using the saved
preferences..

Can someone help me out?

Thanks,
Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] savedInstanceState null?

2011-01-20 Thread TreKing
On Thu, Jan 20, 2011 at 1:48 PM, Chris cbu...@gmail.com wrote:

 I'm trying to save the state of my app while I shut it down but every
 time I bring it back up savedInstanceState is always null..?


If your app is shut down completely, there is no state to save.


  I couldn't seem to find much info on calling onSaveInstanceState properly
 so here's what I did


http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle)
http://developer.android.com/guide/topics/fundamentals.html#actlife
http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle)



 onPause ()
 {...
  Bundle test = new Bundle();
  this.onSaveInstanceState(test);
 }


You're not supposed to be calling onSaveInstanceState - the system does this
for you as an indication that you are liable for axing.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en