Missing initializer?


#1

I think the code listing for CrimeLab is missing the code to initialize the serializer:

private CrimeLab(Context appContext) {
mAppContext = appContext;
mCrimes = new ArrayList();

	mSerializer = new CriminalIntentJSONSerializer(mAppContext, FILENAME);  <-- this appears to be missing.

Without the line above you will get errors saving the data.

It is possible it appears somewhere and I missed it…

edit –
to clarify it is not in listing 17.3 and running the app after listing 17.4 as directed will cause errors. The code does finally appear in listing 17.7


#2

Thanks for the report! It’s added to the Errata: viewtopic.php?f=395&t=6220&p=17171#p17171


#3

This one caught me too.


#4

Actually, the book says the following (which is why I am reading this forum right now):