I have a listview in a fragment. When I scroll down a few items, then select an item, I put a new fragment on the screen with this code:
MyNewFragment fragment = MyNewFragment.newInstance();
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.replace(FRAGMENT_ID, fragment);
ft.addToBackStack(null);
ft.commit();
Then when I hit the back key and go to the first fragment, my listview doesn't save its Y location. I've tried implementing onSaveInstance(), but it doesn't get called when the new fragment is displayed using the above code. I am using the support fragment manager class. What am I doing wrong?