Commit 7bd6ac24 authored by Sajal Narang's avatar Sajal Narang

Fix LoginActivity and MainActivity navigation

parent 98708575
......@@ -37,7 +37,6 @@ ext {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
......
......@@ -32,20 +32,19 @@
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/AppTheme.NoActionBar">
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".LoginActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".LoginActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask">
<intent-filter>
<action android:name="HANDLE_AUTHORIZATION_RESPONSE" />
......@@ -76,10 +75,9 @@
</intent-filter>
</receiver>
<service
android:name=".InstiAppFirebaseMessagingService">
<service android:name=".InstiAppFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
......
......@@ -131,7 +131,10 @@ public class LoginActivity extends AppCompatActivity {
@Override
public void onClick(View v) {
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
}
});
}
......@@ -166,6 +169,7 @@ public class LoginActivity extends AppCompatActivity {
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
progressDialog.dismiss();
finish();
//Save credentials in AccountManager to keep user logged in
//Go to MainActivity
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment