App crashes when touching list item on tablet


#1

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

I finally found out that in CrimeListActivity.java, 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.


#2

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