I have 2 views main view and a login view .
I try to open the Login view after start it works but i I want to add an
event listener for the button in the login.axml there is an error
I tryed more then one possibilitys so I need help
here my code:
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
Dialog _dialog = new Dialog(this);
_dialog.SetContentView(Resource.Layout.Login);
_dialog.SetTitle("Login");
_dialog.SetCancelable(false);
Button _loginButton = (Button) FindViewById
(Resource.Id.LoginButton);
// DialogInterfaceButton _loginButton1 =
FindViewById<DialogInterfaceButton>(Resource.Id.LoginButton);
Toast.MakeText(this, _loginButton.Text,
ToastLength.Long).Show();
_loginButton.Click += new EventHandler(_loginButton_Click);
// _loginButton.Click += new EventHandler(LoginButtonClick);
// Gallery gallery = (Gallery)
FindViewById<Gallery>(Resource.Id.gallery);
//gallery.Adapter = new ImageAdapter (this);
//gallery.ItemClick += delegate (object sender, ItemEventArgs args) {
// Toast.MakeText (this, args.Position.ToString (),
ToastLength.Short).Show ();
//}; (
_dialog.Show();
SetContentView(Resource.Layout.Main);
}
void _loginButton_Click(object sender, EventArgs e)
{
EditText _User = FindViewById<EditText>(Resource.Id.Username);
EditText _Password =
FindViewById<EditText>(Resource.Id.Password);
Toast.MakeText(this, _User.Text, ToastLength.Long).Show();
Toast.MakeText(this, _Password.Text, ToastLength.Long).Show();
}
protected void LoginButtonClick(object sender, EventArgs e)
{
}
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/Login-dialog-tp4492910p4492910.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