No args fragments and newInstance


#1

[code] public static CrimeFragment newInstance(UUID crimeId) {
Bundle args = new Bundle();
args.putSerializable(EXTRA_CRIME_ID, crimeId);

    CrimeFragment fragment = new CrimeFragment();
    fragment.setArguments(args);

    return fragment;
}[/code]

if the fragment doee not take any args , does it still necessary to define newInstance method?


#2

It’s not strictly required, but it is best practice to do so anyway for consistency’s sake.


#3

Thanks you , appreciate your help.