Constructor of CrimeAdapter


#1

Hi,

From Figure 10.5, watching the arrow from CrimeAdapter to CrimeLab, I wonder why the constructor of CrimeAdapter is not like this:

private CrimeAdapter() {
super(getActivity(), 0, CrimeLab.get(getActivity()).getCrimes());
}

instead of calling getCrimes() in onCreate() of CrimeListFragment and passing the result to the CrimeAdapter’s constructor. CrimeAdapter is a Crime-list-specific inner-class adapter, so no need to give a Crime-list from outside.
I rewrite the constructor and confirmed it works.

Is there any good reason to give a Crime-list from outside?

Thanks,