In the Android Activity lifecycle, when Activity.onCreate() is called after resuming (IE. not when activity created initially or in response to screen rotation) would this code return a valid (non-null) Bundle?
public void onCreate(Bundle savedInstanceState) {
Bundle b = this.getIntent().getExtras();
// is b == null? (when activity is resumed)
}
I am trying to reproduce a problem that occurs when the application has not been used for a long period – when the user returns, the application crashes.
I was wondering the same thing and tested this quickly in my application.
It turns out intent extras are available when an activity is re-created after your application got killed.