Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Android.App;
- using Android.Widget;
- using Android.OS;
- using Android.Content.Res;
- using Android.Graphics.Drawables;
- namespace spinnerPic
- {
- [Activity(Label = "spinnerPic", MainLauncher = true, Icon = "@drawable/icon")]
- public class MainActivity : Activity
- {
- protected override void OnCreate(Bundle bundle)
- {
- base.OnCreate(bundle);
- // Set our view from the "main" layout resource
- SetContentView (Resource.Layout.Main);
- string username = "5";
- string password = "5";
- EditText txtUser = FindViewById<EditText>(Resource.Id.txtUser);
- EditText txtPass = FindViewById<EditText>(Resource.Id.txtPassword);
- Button btnLogin = FindViewById<Button>(Resource.Id.btnLogin);
- Button btnRegister = FindViewById<Button>(Resource.Id.btnRegister);
- btnRegister.Click += delegate {
- StartActivity(typeof(Registration));
- };
- btnLogin.Click += delegate {
- if (txtUser.Text == username && txtPass.Text == password) {
- StartActivity(typeof(frmFeed));
- }
- else {
- Toast.MakeText(this,"Login Failed",ToastLength.Long).Show();
- }
- };
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement