i craete an android application with four buttons in the first interface and i need each button to open another screen when clicked i did it correctly with the first button using this code
- using Android.App;
- using Android.Widget;
- using Android.OS;
-
- namespace fitness_ghadi
- {
- [Activity(Label = "fitness_ghadi", MainLauncher = true , Icon ="@drawable/icon")]
- public class MainActivity : Activity
- {
- protected override void OnCreate (Bundle bundle)
- {
- base.OnCreate(bundle);
-
- SetContentView(Resource.Layout.Main);
- Button button = FindViewById<Button>(Resource.Id.second);
- button.Click += delegate {
- StartActivity(typeof(second));
- };
- }
-
- }
- }
and this
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
-
- using Android.App;
- using Android.Content;
- using Android.OS;
- using Android.Runtime;
- using Android.Views;
- using Android.Widget;
-
- namespace fitness_ghadi
- {
- [Activity(Label = "second")]
- public class second : Activity
- {
- protected override void OnCreate(Bundle savedInstanceState)
- {
- base.OnCreate(savedInstanceState);
- SetContentView(Resource.Layout.Second);
- Button button = FindViewById<Button>(Resource.Id.First);
- button.Click += delegate {
- StartActivity(typeof(MainActivity));
- };
-
- }
- }
- }
but when i try to make the same code for the rest buttons it did't work i found errors , how can i do it please?