I followed this tutorial for drag and drop listview implementation based on component that the Music app’s playlist uses.
http://www.techrepublic.com/blog/australia/making-a-sortable-listview-in-android/708
Dragable listview works fine, but in the interface builder there is the error:
The following classes could not be instantiated:
- com.ib.myproject.TouchInterceptor (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
Here it is the part of the xml file:
<com.ib.myproject.TouchInterceptor
android:id="@+id/listViewBankList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawSelectorOnTop="false"
android:fastScrollEnabled="true">
</com.ib.myproject.TouchInterceptor>
That error is telling you that the interface builder can’t display anything as there is code logic which it can’t resolve by itself. In your custom view you can use
View.isInEditMode()to declare code which will only be called by the interface builder.So either in your view or the containing activity/fragment, you can define something such as: