Hi,
I have a custom ListView using ListViewItems containing two buttons.
I'd like to catch click event on EACH of the buttons in the listview.
I've seen that I can define the handler in the list_item.axml, and implement
it in the activity class.
So I did it :
<Button android:id="@+id/art_qte_minus"
android:layout_alignTop="@id/art_lib"
android:layout_toRightOf ="@id/art_lib"
android:layout_width="96dp"
android:layout_height="96dp"
android:gravity="center"
android:textSize="48sp"
android:text="-"
android:onClick="Onqte_minus_clicked"/>
And for the activity :
public class CatalogueActivity : Activity
{
void Onqte_minus_clicked(View v)
{
Log.Debug(_logTag, "Onqte_minus_clicked");
}
}
but when I click, app crashes and adb log tells me :
E/AndroidRuntime(27673): java.lang.IllegalStateException: Could not find a
method Onqte_minus_clicked(View) in the activity class
monopharma.CatalogueActivity for onClick handler on view class
android.widget.Button with id 'art_qte_minus'
E/AndroidRuntime(27673): at
android.view.View$1.onClick(View.java:2670)
E/AndroidRuntime(27673): at
android.view.View.performClick(View.java:3110)
I don't get it...
ButtonView.id : ok
Handler signature : ok
contained in activity class : ok
So what's wrong?
Thx !
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/Onclick-event-handler-on-button-contained-in-a-listview-item-tp4939699p4939699.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid