The Activity Must Be Exported or Contain an Intent-Filter

Error running second Activity: The activity must be exported or contain an intent-filter

Put android:exported="true" in the <activity> tag

<activity android:name=".secondActivity"
android:exported="true">

Error running 'splash': The activity must be exported or contain an intent-filter

You should switch intent-filter from MainActivity to splash.

Below you will find the solution:

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<activity android:name=".splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

<activity android:name=".MainActivity"/>
</application>

Don't forget to extend AppCompatActivity in splash.

Also, I recommend to rename splash to SplashActivity



Related Topics



Leave a reply



Submit