I have an already established activity that must extend another activity so I'd much rather use commonsware drag and drop TouchListView class with my existing activity rather than extend ListActivity. However, I can't find an example of how to do this. In my activity's xml I have included:
<com.test.dragdrop.TouchListView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tlv="http://schemas.android.com/apk/res/com.test.activities"
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawSelectorOnTop="false"
tlv:normal_height="64dip"
tlv:expanded_height="128dip"
tlv:grabber="@+id/icon"
tlv:remove_mode="slideRight"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_below="@id/menu_bar_top_include"
android:layout_above="@id/footerbar_lists"
android:cacheColorHint="#0000"
android:paddingTop="2dip"/>
Now, I'm not sure how translate this to creating it dynamically in my actvities code . I assume I have to place the code in onCreate() and create a RelativeLayout wrapper and put the TouchListView class inside of it, but again I'm not sure when it comes to a custom view class... any one do this before?
Note: I also tried to simply use :
TouchListView tlv = (TouchListView) findViewById(R.id.list);
but I get compiler errors:
--- for some reason the compiler cannot find "R.id.list" --- Is this because its inside a custom view? Is there some other way this needs to be specified?