title: Adding a click listener to the Drag-Sort-Listview library
body: <p>I've implemented this library based off a listfragment, and its implementation is very similar to this code sample on the library's github repo:</p>
  
  <p><a href="https://github.com/bauerca/drag-sort-listview/blob/master/demo/src/com/mobeta/android/demodslv/DSLVFragment.java" rel="nofollow">https://github.com/bauerca/drag-sort-listview/blob/master/demo/src/com/mobeta/android/demodslv/DSLVFragment.java</a></p>
  
  <p>My question is, how do I implement a click listener?</p>
  
  <p>This is my xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;com.mobeta.android.dslv.DragSortListView
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:dslv="http://schemas.android.com/apk/lib/com.mobeta.android.dslv"
      android:id="@android:id/list"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:padding="3dp"
      dslv:drag_handle_id="@drawable/bg_handle"
      android:layout_margin="3dp"
      android:dividerHeight="2dp"
      dslv:drag_enabled="true"
      dslv:collapsed_height="2dp"
      dslv:drag_scroll_start="0.33"
      dslv:max_drag_scroll_speed="0.5"
      dslv:float_alpha="0.6"
      dslv:slide_shuffle_speed="0.3"
      dslv:track_drag_sort="false"
      dslv:float_background_color="@color/blue"
      android:focusable="false"
      android:focusableInTouchMode="false"
      dslv:use_default_controller="false" /&gt;
  </code></pre>
  
  <p>And this is how I've tried to create a click listener, but it doesn't respond:</p>
  
  <pre><code>@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
      mDslv = (DragSortListView) inflater.inflate(getLayout(), container, false);
  
  mController = buildController(mDslv);
  mDslv.setFloatViewManager(mController);
  mDslv.setOnTouchListener(mController);
  mDslv.setDragEnabled(dragEnabled);
  
  
  SimpleFloatViewManager simpleFloatViewManager = new SimpleFloatViewManager(mDslv);
  simpleFloatViewManager.setBackgroundColor(Color.TRANSPARENT);
  mDslv.setFloatViewManager(simpleFloatViewManager);
  
  mDslv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
          System.out.println("Clicked!");
      }
  });
  
  
  return mDslv;
  </code></pre>
  
  <p>}</p>