Custom android launcher goes back to default launcher on pressing back button

android, launcher

Solution

This seemed to work for me Kotlin

override fun onBackPressed() {}

Java

@Override
public void onBackPressed() {}

Problem

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

Original source