Two-pane layout support.
Use arguments instead of intent extras to populate the detail fragment.
Select item type based on style.
Preserve selected item on device rotation
Fix for NPE

The actual fix was to check in MainActivity if there was a savedInstanceState or not. If there was, don't bother creating a new fragment, because getActivity() will return null.
Everything else is just making the code match.