Use my own Android app/apk as launcher/Home Screen Replacement

Setting the correct intent filters in your manifest will allow it be prompt you to use it as a replacement: <activity android:name=”Home” … android:launchMode=”singleInstance” android:stateNotNeeded=”true”> <intent-filter> <action android:name=”android.intent.action.MAIN” /> <category android:name=”android.intent.category.HOME”/> <category android:name=”android.intent.category.DEFAULT” /> </intent-filter> </activity> See the Intents and Intent Filters documentation from Google.

android: choose default launcher programmatically

Try using the following: Intent startMain = new Intent(Intent.ACTION_MAIN); startMain.addCategory(Intent.CATEGORY_HOME); startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(startMain); If a default action is already set (yours), you can call first: getPackageManager().clearPackagePreferredActivities(getPackageName()); If the default action is not yours, you cannot clear it programmatically, what you can do is to check if other app is set as default and show a message.. … Read more

How to add shortcut to Home screen in android programmatically [duplicate]

Android provide us an intent class com.android.launcher.action.INSTALL_SHORTCUT which can be used to add shortcuts to home screen. In following code snippet we create a shortcut of activity MainActivity with the name HelloWorldShortcut. First we need to add permission INSTALL_SHORTCUT to android manifest xml. <uses-permission android:name=”com.android.launcher.permission.INSTALL_SHORTCUT” /> The addShortcut() method creates a new shortcut on Home … Read more

How can I create a custom home-screen replacement application for Android?

Writing your own home screen application is possible. It is called the Launcher. You can get the source code of the default Android Launcher via Git. The project URL is: https://android.googlesource.com/platform/packages/apps/Launcher2.git You can get the source code like this: git clone https://android.googlesource.com/platform/packages/apps/Launcher2.git That will create a directory called Launcher2 for you. Now you can get … Read more

Going to home screen programmatically

You can do this through an Intent. Intent startMain = new Intent(Intent.ACTION_MAIN); startMain.addCategory(Intent.CATEGORY_HOME); startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(startMain); This Intent will start the launcher application that the user has defined. Be careful with this because this will look like your application crashed if the user does not expect this. If you want this to build an exit button … Read more