2

I am creating an android app that needs a user login page. Should I make the login activity as my main activity or create another activity for the login screen? What is the correct work flow and what are the cons and pros of having login activity as my main activity?

Pika Supports Ukraine
  • 3,612
  • 10
  • 26
  • 42
Animesh Jaiswal
  • 331
  • 3
  • 7
  • 2
    NO. The *main* activity is the activity which is used most. Or the one which is to be considered the *base* activity. You want to *start* with a login activity. And only *start* with that one, not to return to that one when you are done with other activities. So simply set it as your LAUNCHER activity. – Phantômaxx Mar 07 '19 at 14:35

2 Answers2

1

You should create a new LoginActivity and set it to your launcher activity in the AndroidManifest.xml like answered in this post.

DenseCrab
  • 1,273
  • 11
  • 22
0

I would recommend using a single activity with fragments - for example, the Navigation Architecture Component is a great tool that gives you just this.

What I like the most in this API is that :

1) Its really a very Small API

2) You have a very nice display of your app flow with a nice diagram

Tamir Abutbul
  • 7,301
  • 7
  • 25
  • 53