Code example for ListFragment

Methods: getListView, onActivityCreated, registerForContextMenu

0
     * {@inheritDoc } 
     */ 
    @Override 
    public void onActivityCreated(Bundle savedInstanceState)
    { 
        super.onActivityCreated(savedInstanceState);
        registerForContextMenu(getListView());
    } 
 
    /** 
     * {@inheritDoc } 
     */ 
    @Override 
    public void onAttach(Activity activity)
    { 
        super.onAttach(activity);
        try 
        { 
            // check that the containing activity implements our callback 
            mContainerCallback = (CommuneListEventsCallback) activity;
            mActivity= activity;