I am making a launcher app for Android. Inside the main activity, I have overriden the onNewIntent
function. When I open an app from my launcher, and then back press, I am sent back to my launcher’s home screen. I expect onNewIntent
to be called at that exact moment but it is never called. Here is my onNewIntent function :
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
System.out.println("Called");
}
And here is the manifest :
<activity
android:name="com.example.launcher.MainActivity"
android:clearTaskOnLaunch="true"
android:excludeFromRecents="true"
android:exported="true"
android:screenOrientation="portrait"
android:launchMode="singleTask"
android:stateNotNeeded="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
I do not understand why onNewIntent
isn’t invoked.