I'm new to Android development, and what I playing around with is a sports type app with a app flow like: League -> Team -> Player -> Player stats (this is in a ViewPager). All using Fragments.
I have the flow working in this direction, but I'm trying to use home button to navigate back up the stack (back button works too). My problem is that going forward through the flow I pass the ID of the League, then Team, then Player, etc... But when the home button is pressed, this data is no longer available.
I've tried setting retainInstance to true, but that doesn't do it. Not sure why, but the ID fields are all null in onCreate whenever I press back or the home button.
I've also tried overriding onSaveInstance and onActivityCreated, and putting the ID's for each entity in the bundle there, but even though I save the ID in the bundle in onSaveInstance, the bundle is null in onActivityCreated.
How can I keep the ID's of each entity around for when the user hits the back or home buttons?
Thanks for any help.