Created
September 22, 2015 18:26
-
-
Save orhanobut/9f6c9b4f9ad6552c87f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ProductListFragment extends Fragment { | |
private static final String KEY_UUUID = "KEY_UUID"; | |
private String uuid; | |
@Override public void onCreate(Bundle bundle) { | |
super.onCreate(bundle); | |
if (bundle != null && bundle.containsKey(KEY_UUID)) { | |
uuid = bundle.getString(KEY_UUID); | |
} else { | |
uuid = UUID.randomUUID().toString(); | |
} | |
} | |
@Override public void onSaveInstanceState(Bundle outState) { | |
outState.putString(KEY_UUID, uuid); | |
super.onSaveInstanceState(outState); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment