app/src/main/java/com/anuj/twitter/fragments/PageFragment.java
@Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        if (activity instanceof OnItemSelectedListener) {
            listener = (OnItemSelectedListener) activity;
        } else {
            throw new ClassCastException(activity.toString()
                    + " must implement PageFragment.OnItemSelectedListener");
        }
    }
// Store the listener (activity) that will have events fired once the fragment is attached
Store the listener (activity) that will have events fired once the fragment is attached
Store the listener ( activity ) that will have events fired once the fragment is attached
@Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        if (activity instanceof OnItemSelectedListener) {
            listener = (OnItemSelectedListener) activity;
        } else {
            throw new ClassCastException(activity.toString()
                    + " must implement PageFragment.OnItemSelectedListener");
        }
    }
@ Override public void onAttach ( Activity activity ) { super . onAttach ( activity ) ; if ( activity instanceof OnItemSelectedListener ) { listener = ( OnItemSelectedListener ) activity ; } else { throw new ClassCastException ( activity . toString ( ) + " must implement PageFragment.OnItemSelectedListener" ) ; } }
Store the listener (activity) that will have events fired once the fragment is attached
Store the listener ( activity ) that will have events fired once the fragment is attached