Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the main launcher activity programmatically

Tags:

android

My app works as launcher. 10 mins later another activity starts automatically. When this activity started, if user presses home button, he returns to the main activity. However, I want to change the launcher activity as the second one. It must be forbidden to return to the main activity even if he presses home button.

like image 491
halilkaya Avatar asked Jan 13 '23 23:01

halilkaya


1 Answers

Instead of playing around with the intent filters, I suggest you create a blank Activity, with no UI, and register it as your launcher. This Activity's sole role is to choose the correct actual Activity you wanna show, launch it as a new task, and then quit silently.

like image 150
Vaiden Avatar answered Jan 16 '23 00:01

Vaiden