Code example for ListFragment

Methods: onDetach

0
        mCallbacks = (Callbacks) activity;//
    } 
 
    @Override 
    public void onDetach() { 
        super.onDetach(); 
        mCallbacks = sDummyCallbacks;
    } 
 
    @Override 
    public void onListItemClick(ListView listView, View view, int position, long id) {
        super.onListItemClick(listView, view, position, id);
         
        mCallbacks.onItemSelected(String.valueOf(position));
    } 
 
    @Override 
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        if (mActivatedPosition != ListView.INVALID_POSITION) {
            outState.putInt(STATE_ACTIVATED_POSITION, mActivatedPosition);