@Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);

        // Activities containing this fragment must implement its callbacks.
        if (!(activity instanceof Callbacks)) {
            throw new IllegalStateException("Activity must implement fragment's callbacks.");
        }

        mCallbacks = (Callbacks)activity;
    }
Mandatory empty constructor for the fragment manager to instantiate the
fragment (e.g. upon screen orientation changes).
Example/src/com/tonicartos/stickygridheadersexample/ItemListFragment.java