botguide
botguide

Reputation: 139

Is there any way to run the current activity page without launching main activity in android

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.

Upvotes: 0

Views: 295

Answers (2)

Umar Farooq
Umar Farooq

Reputation: 281

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

Upvotes: 0

Mittchel
Mittchel

Reputation: 1926

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));
  };

Upvotes: 0

Related Questions