Click here to Skip to main content
15,885,936 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Here is my code:

Button choice1Button1 = FindViewById<Button> (Resource.Id.choice1Button1);
            choice1Button1.Click += delegate(object sender, System.EventArgs e) 
            {
                SetContentView (Resource.Layout.Event3);    
            };

            Button choice2Button1 = FindViewById<Button> (Resource.Id.choice2Button1);
            choice2Button1.Click += delegate(object sender, System.EventArgs e) 
            {
                SetContentView (Resource.Layout.Event4);    
            };
The issue is, is that when I click either of the buttons, nothing happens. I have multiple layout pages, and an Activity page to go with each one.

The first page is Main.xaml and uses MainActivity.cs
All the other pages use Event2(3,4,5 etc.).xaml and Event2(3,4,5 etc.)Activity.cs

If I move the code and the buttons to MainActivity.cs, the buttons work, but they don't work in other Activity files. Any help would be greatly appreciated. 


What I have tried:

If I move the code and the buttons to MainActivity.cs, the buttons work, but they don't work in other Activity files.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900