I am stuck with writing a C# Mono for Android equivalent of following Java event handler code:
public class Player extends ListActivity
{
private ImageView list;//basically this is a buttona
private void SetupButtonListeners()
{
list.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
//do stuff
}
});
}
/*
more stuff here
*/
}
API REF: http://androidapi.xamarin.com/?link=T%3aAndroid.Widget.Button
There is no anonymous interface implementations in C# which is what you need according to documentaton:
Unless there is some helper classes already you need to write class that implements this interface and pass it in. If you can’t find existing one you should be able to create helper function that creates class and takes delegate as implementation of OnClick method.