Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 590
rohanneps Avatar asked Feb 09 '14 20:02

rohanneps


People also ask

How do I permanently change my launcher on Android?

Change default Android launcherWith some Android phones you head to Settings > Home, and then you choose the launcher you want. With others you head to Settings > Apps and then hit the settings cog icon in the top corner where you'll then options to change default apps.

How do I disable the default launcher?

Go to Settings > Apps/Applications > scrolll down to the launcher that is the default for your Android device > scroll down and tap on 'Clear defaults'. Defaults are set when you are asked to set a launcher just once or always.


1 Answers

This seemed to work for me
Kotlin

override fun onBackPressed() {}

Java

@Override
public void onBackPressed() {}
like image 76
nik Avatar answered Oct 21 '22 14:10

nik