0
  private void userIsLoggedIn() {
    FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
    if(user != null){
        Intent i = new Intent(getApplicationContext(), MainPageActivity.class);
        i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(i);
        finish();
    }
}

That is the code that should change the activity ^^

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.tylerwilliams.openmessagingv2">

<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="Spectrum Messenger"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="GoogleAppIndexingWarning">
        <activity android:name=".MainPageActivity" />
        <activity
            android:name=".LoginActivitys"
            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=".FindUserActivity" />
    </application>

</manifest>

That is my manifest code, I have tried to change it but whenever I do I either make more problems or it won't work. I am pretty sure its me just being a noob and that I have got something in the manifest wrong.

0 Answers0