Question

I am working on a launcher application. It is being show along with the default launcher on pressing the back button. However, wherever I am in my custom launcher or whether in the starting page of my launcher it self, when I press the back button, the screen navigates back to the default android launcher. I need help. This is the code I used to set my app as a launcher

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

            <category android:name="android.intent.category.HOME" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.MONKEY" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

thank you in advance

No correct solution

OTHER TIPS

This seemed to work for me
Kotlin

override fun onBackPressed() {}

Java

@Override
public void onBackPressed() {}

Those are categories for intents, android.intent.category.LAUNCHER just means when you run the application it will launch the specified class

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top