App crashes when touching list item on tablet


My app kept crashing, complaining that “activity” could not be cast to “Callbacks” in

I finally found out that in, you need to define the class as:

public class CrimeListActivity extends SingleFragmentActivity implements CrimeListFragment.Callbacks, CrimeFragment.Callbacks

Listing 22.13 should include code that highlights the fact that you need to specify CrimeFragment.Callbacks here.


Thanks for the note! We’ve included that in the errata.