What i had done: I have made a custom launcher that actually runs/sets as a home screen launcher upon load. Also it appears in the installed launchers list, which means everything is good so far.
What i want: But, when i launch/set my application as launcher and press back button, it goes to the previously set launcher screen.
It should not be like this i guess. It shall remain set like a home/default launcher of the device.
My Code Additions:
In my manifest i added following:
<activity
android:name=".Main"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<!-- These two lines are setting it as a launcher-->
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
Any idea how i can achieve my goal ?
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.
An app launcher replaces the stock user interface for organizing the home screen and app icons predominantly in the Android world; however, they are also available for jailbroken iPhones (see iPhone jailbreaking and Cydia). See Launchpad and app drawer.
You are certainly welcome to intercept the BACK button in your activity, by overriding onBackPressed()
, and preventing it from destroying the activity by simply not chaining to the superclass.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With