Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a login activity before mainactivity

Tags:

android

is it possible to get a login activity in between splash and main activity in android studio.`it should be after splash activity and before main.how to get it.

<?xml version="1.0" encoding="utf-8"?>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".Splash"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".Register"
              android:label="@string/title_activity_register"
              android:theme="@style/AppTheme.NoActionBar"/>
    <activity android:name=".MainActivity"
        android:theme="@style/AppTheme.NoActionBar"/>
</application>

like image 829
sun Avatar asked Oct 19 '22 23:10

sun


1 Answers

You may change your manifest like this

<application
        android:allowBackup="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:logo="@drawable/icon"
        >
        <activity
            android:name=".SplashActivity"
            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=".LoginPage"></activity>
        <activity android:name=".MainPage"></activity>
</application>

and make sure your intents are appropriare in order

like image 156
Parth Anjaria Avatar answered Nov 15 '22 04:11

Parth Anjaria