I have an LogIn activity screen for a user to log into my app.
I wrote this in my manifest as I want the app to start on this logIn activity:
<activity android:name=".LogInActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".UserPostActivity" android:label="@string/app_name"></activity>
Once the user logs on, the app saves a token / boolean into SharedPreferences so that the app knows the user has logged in already and doesn't not load the logon activity next time the user starts my app - instead it will go to the UserPostActivity which will show user posts. It starts the UserPostActivity using an intent.
This is typical of apps like Facebook where you login once and then it moves onto the user Feeds each time you use your app.
I'm unsure if this is the most efficient pattern to code the app as then it always has to go to LogInActivity first, check the boolean / token and then use the intent to move to UserPostActivity each time a logon user uses the app. I'm concerned about the impact on startup time of the app with this current flow.
Is there a better way to code this?