Hi all,
I am new to Xamarin andd not new to c#.. but I am running into issue here. My app in the android emulator starts and quickly closes before all the contents are loaded.
Here is my code. Just a simple hello world
namespace Helloword
{
[Activity (Label = "Helloworld", MainLauncher = true)]
public class MainActivity : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
LinearLayout ll = new LinearLayout (this);
ll.Orientation = Orientation.Vertical;
TextView label = new TextView (this);
label.Text = "Hi There";
Button btn = new Button (this);
btn.Text = "click me";
btn.Click += (object sender, EventArgs e) =>
{
label.Text = "good";
btn.Text = "you clicked me";
};
ll.AddView(btn);
ll.AddView(label);
SetContentView(ll);
}
}
}
anything I'm doing wrong?