Sub ListView_MakeCheckable(xListView As ListView, xDrawable As Object, MultiCheck As Boolean)
Dim xRef1 As Reflector
Dim xInt1 As Int
Dim xArgs(1) As Object
Dim xTypes(1) As String
xRef1.Target = xListView
If MultiCheck Then
xInt1 = 2
Else
xInt1 = 1
End If
xRef1.RunMethod2("setChoiceMode", xInt1, "java.lang.int")
xArgs(0) = xDrawable
xTypes(0) = "android.graphics.drawable.Drawable"' StateListDrawable"
xRef1.RunMethod4("setSelector", xArgs, xTypes)
End Sub
Sub ListView_SetItemChecked(xListView As ListView, Position As Int, SetChecked As Boolean)
Dim xRef1 As Reflector
Log("Selecting: " & Position & "-> " & SetChecked)
xRef1.Target = xListView
xRef1.RunMethod3("setItemChecked", Position, "java.lang.int", SetChecked, "java.lang.boolean")
End Sub
<?xml version="1.0" encoding="utf-8"?>
<selector android:id="@+id/myselector" xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@drawable/listviewsel_selected" />
<item android:state_pressed="true" android:drawable="@drawable/listviewsel_selected" />
<item android:state_checked="true" android:drawable="@drawable/listviewsel_marked" />
<item android:state_hovered="true" android:drawable="@drawable/listviewsel_hovered" />
</selector>