protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.recvactivity);

            textView1    = FindViewById <TextView>(Resource.Id.textView1);
            textView2    = FindViewById <TextView>(Resource.Id.textView2);
            buttonBack   = FindViewById <Button>(Resource.Id.buttonBack);
            buttonAdd2   = FindViewById <Button>(Resource.Id.buttonAdd2);
            globalsText2 = FindViewById <TextView>(Resource.Id.globalsText2);

            string text1 = Intent.GetStringExtra("name" ?? "Not rec");
            string text2 = Intent.GetStringExtra("email" ?? "Not rec");

            textView1.Text = text1;
            textView2.Text = text2;

            buttonBack.Click += delegate
            {
                this.Finish();
            };

            buttonAdd2.Click += delegate
            {
                Globals.AddNewStatus(1);
                string resposta = "nelemens" + Globals.StatusApplication.Count.ToString();
                resposta         += "element" + Globals.StatusApplication[Globals.StatusApplication.Count - 1].ToString();
                globalsText2.Text = resposta;
            };
        }
示例#2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);
            editText1    = FindViewById <EditText>(Resource.Id.editText1);
            editText2    = FindViewById <EditText>(Resource.Id.editText2);
            buttonAdd1   = FindViewById <Button>(Resource.Id.buttonAdd1);
            globalsText1 = FindViewById <TextView>(Resource.Id.globalsText1);
            buttonGo     = FindViewById <Button>(Resource.Id.buttonGo);
            buttonGo2    = FindViewById <Button>(Resource.Id.buttonGo2);


            buttonGo.Click += (s, e) =>
            {
                Intent nextActivity = new Intent(this, typeof(RecvActivity));
                nextActivity.PutExtra("name", editText1.Text);
                nextActivity.PutExtra("email", editText2.Text);
                StartActivity(nextActivity);
            };

            buttonGo2.Click += (s, e) =>
            {
                Intent nextActivity = new Intent(this, typeof(ComActivity));
                StartActivity(nextActivity);
            };

            buttonAdd1.Click += delegate
            {
                Globals.AddNewStatus(0);
                string resposta = "nelemens" + Globals.StatusApplication.Count.ToString();
                resposta         += "element" + Globals.StatusApplication[Globals.StatusApplication.Count - 1].ToString();
                globalsText1.Text = resposta;
            };
        }