How to spice out the sequence of activities to start?

2

Hello. I have a doubt. I have an APP in which 8 Activities, including a Splash Screen Activity that displays my logo and then enters my APP.

The Splash Screen is set to default, but I need to set another Activity to be started after the screen that has the logo, because it is starting another Activity that is not the initial screen of the App. How could I do this?

Follow my AndroidManifes.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

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

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity" />
        <activity android:name=".Main"/>
        <activity android:name=".ContraDenuncia" />
        <activity android:name=".FavorDenuncia" />
        <activity android:name=".Investigados" />
        <activity android:name=".Objetivo" />
        <activity android:name=".SplashScreenActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>/>
        </activity>

    </application>

</manifest>

I need Activity Main to run after SplashScreenActivity.

Thank you very much.

    
asked by anonymous 18.09.2017 / 20:43

1 answer

1

You will have to have your other activity started after running your splash. But before that, put <activity android:name=".SplashScreenActivity"> as the first in the manifest. After that go in the code of your splash, and after finishing to execute the splash, put this

    Intent it = new Intent(this, MainActivity.class);
    startActivity(it);

In the definition of intenent, you are specifying say "where to where" and the startActivity () method is to start the activity defined in Intent

    
18.09.2017 / 20:48