Skip to content

Instantly share code, notes, and snippets.

View igoriols's full-sized avatar

Igor Oliveira igoriols

View GitHub Profile
@igoriols
igoriols / StatefulFragment.txt
Last active December 30, 2020 15:49
How to properly retain state of fragments in back stack without using setRetainInstance(true).
/**
* @author Igor Oliveira
*/
public abstract class StatefulFragment extends Fragment {
private Bundle savedState;
private boolean saved;
private static final String _FRAGMENT_STATE = "FRAGMENT_STATE";
@Override