I'm using a ViewPager and a FragmentManager to fill some EditText and click on next button to go ahead. But when I click on the previous button to go back to the last fragment, the information inside the form are lost, because I always re-instantiate each fragment like this:
void previousFragment(){
Fragment newFragment = new RegisterLink_();
final FragmentManager fm = getActivity().getSupportFragmentManager();
final FragmentTransaction ft = fm.beginTransaction();
ft.setCustomAnimations(R.anim.in, R.anim.out);
ft.replace(R.id.register_upload, newFragment);
ft.addToBackStack(null);
ft.commit();
}
}
Can someone please tell me how to swipe from a fragment to another one without losing the information inserted by the user. Thanks for your help and sorry for my weak english.