@Override public void onAttach(Activity activity) { super.onAttach(activity); // Check that the container activity has implemented the callback // interface try { mListener = (OnTaskListItemClickedListener) activity; } catch (ClassCastException e) { throw new ClassCastException( activity.toString() + " must implement OnTaskListItemClickedListener"); // $NON-NLS-1$ } }