Code example for Fragment

Methods: onDetach

0
    } 
 
    @Override 
    public void onDetach() { 
        demoSelectedListener = null;
        super.onDetach(); 
    } 
 
    @Override 
    public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
        if (demoSelectedListener == null) return;
 
        Map<String, Object> item = (Map<String, Object>) adapter.getItem(position);
        demoSelectedListener.onDemoSelected((String) item.get("class"), (Bundle) item.get("args"));
    } 
 
    /** 
     * Sets choice mode for the list 
     * 
     * @param selectable whether list is to be selectable.