Code example for Fragment

Methods: onDetach

    public void onDetach() { 
        demoSelectedListener = null;
    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. 
Contextual code suggestions in your IDE  Get Codota for Java