I have the following code for an Android app in C#
using Android.App;
using Android.Widget;
using Android.OS;
namespace Practicum1
{
[Activity(Label = "Practicum 1.2.1", MainLauncher = true)]
public class MainActivity : Activity
{
EditText invullen;
TextView displaynaam;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
TextView begintekst;
begintekst = new TextView(this);
begintekst.Text = "Vul je naam in!";
invullen = new EditText(this);
invullen.TextChanged += naam_textChanged;
displaynaam = new TextView(this);
displaynaam.Text = "Hier kom je naam te staan";
LinearLayout stapel;
stapel = new LinearLayout(this);
stapel.Orientation = Orientation.Vertical;
stapel.AddView(begintekst);
stapel.AddView(invullen);
stapel.AddView(displaynaam);
// Set our view from the "main" layout resource
this.SetContentView(stapel);
}
private void naam_textChanged(object sender, ItemEventArgs ea)
{
displaynaam.Text = "Welkom " + invullen.Text;
}
}
}
But then I get the following error message: 'No overload for naam_textChanged matches delegate EventHandler
Does anyone know how to solve this?
Regards, Joren