noobHERE
noobHERE

Reputation: 135

How to switch to another page with xamarin for visual studio?

I was wondering whats the best way to switch to another page while programming with c# with mono for android programming? (eg. " having a menu lead to the actual activity when u press a button")... The code and some examples would be very helpful, thanks you. (im using linear layout by the way)

Upvotes: 1

Views: 5546

Answers (1)

Stephane Delcroix
Stephane Delcroix

Reputation: 16222

From xamarin doc:

var showSecond = FindViewById<Button> (Resource.Id.showSecond);
showSecond.Click += (sender, e) => {
    StartActivity (typeof(SecondActivity));
};

StartActivity(Type activityType) is what you're looking for.

Upvotes: 5

Related Questions