0
votes

I have designed a user interface for my app in xamarin android. I have the main activity , the login activity , which is the first page that should be launched in the app. Now I have designed a second user interface(a home page). I need to launch this second activity , so that I can test whether it looks good. Is it possible to launch the second activity independent of the first activity (Loginpage). What I mean is that , is it possible to launch (run) the home page separately. My home page activity code is

namespace Homepage

{ [Activity(Label = "Homepage")] public class Homepage : Activity { protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState);

        // Create your application here
        SetContentView(Resource.Layout.Homepage);
    }
}

}

Thank you.

2

2 Answers

0
votes

So, if I understand correctly you just basically would like the show the Homepage so you can see the UI?

Why don't you just Start the Homepage activity when you click on the Login button? This way you can have both pages with just one click apart from each other. Also, the flow will be visualized.

button.Click += delegate {
   StartActivity(typeof(HomePage));
  };
0
votes

if you want to run only HomePage activity that contains layout.axml, just set MainLauncher = true in activity flag like

[Activity(Label = "HomePage", MainLauncher = true)] 

and must remember to remove MainLuncher = true from your main activity flag