My android application always be in launcher list - android

hi i am new in android application Development
after successfully Developed android application when i install apk of that application it is always under launcher list, and always ask to select default launcher when i press Home key. How to prevent app. to be in list under launcher.
manifest file code are as follow.
//Manifest
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.dewebclient.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.example.dewebclient.IpConfigure" ></activity>
<activity android:name="com.example.dewebclient.WebViewClientDE" />
<!--android:theme="#android:style/Theme.NoTitleBar"-->
</application>

Remove below line from your AndroidManifest.xml file.
<category android:name="android.intent.category.HOME" />
Explanation :
The category HOME is used to declare your application as a Home launcher. By putting this in the AndroidManifest.xml, user will have the option to have your application open upon pressing the home button.
According to Developer Docs.
This is the home activity, that is the first activity that is displayed when the device boots.

<category android:name="android.intent.category.HOME" />
Remove above line from AndroidManifest.xml .

<category android:name="android.intent.category.HOME"/>
Remove this and check.
This indicates that when you press home button, your app will be listed as an option to launch the launcher home or your home activity (along with all the applications which have this category in their manifest for an activity). To be more simple, whenever you press the home button, all the applications installed in your phone which have CATEGORY.HOME category and Action_Main in intent-filter in their AndroidManifest.xml will be listed (unless you have chosen some application as default) in a chooser for the user to select which HOME they want to launch.

change your intent filter look like below.
and relaunch application.
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
referenc this link

Related

android home application not starting after reboot why?

i have an android tv application and need to make it launcher application and home application
i added the below code in manifest
<activity
android:name=".ui.main.LandingActivity"
android:launchMode="singleInstance"
android:stateNotNeeded="true"
android:exported="true"
android:screenOrientation="landscape">
<intent-filter>
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</activity>
Also in Settings -> Default -> Home App -> i select my own application
So when i click home button in device it navigate to the launcher activity of my application, but when i restart the device , the application set as default doesn't run by default and immediately
i checked the settings and make sure that is selected by default.
So why the app is not opened by default after reboot?
try
android:launchMode="singleTask"

How to make the app as launcher and the only open app in Android?

Is there a way to make my app the only running app in a device, what I mean is the only visible and open app? Once the device booted, the app will launch automatically while any tap to settings at status bar, back, home and recent apps button are disabled. Probably a custom Android OS is required or rooting the device will be enough? We plan to have a set of devices where users can only operate with one app. Thanks
You need to be able to remove current launcher app to the system part of the device.
Then it's as simple as:
Adding android:launchMode="singleTask" to activity tag in AndroidManifest.xml
Adding <category android:name="android.intent.category.DEFAULT" /> and
<category android:name="android.intent.category.HOME" /> to your intent filter
The end result should look similar to this:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.app.MainActivity"
android:launchMode="singleTask"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</activity>
</application>

How to open a settings page specific to devices using activity name or package name?

I have a system settings activity called .settings.AppLockSettingsActivity and I want to launch that settings page when my app launches. App is a simple launcher doesn't show other pages except the settings.
Add to this intent filters in your AndroidManifest.xml
<activity
android:name=".settings.AppLockSettingsActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
and if somewhere intent filters is written, delete them as well

Set Home Launcher via ADB

I want my app to be in KIOSK mode every startup, so in my AndroidManifest.xml I define my MainActivity as
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</activity>
I am developing in an S99 smart watch. Unfortunately, I couldn't find a setting item where I can customize its default home launcher.
Home launcher selection won't also display when I tap the home menu.
So I am thinking to have it via ADB. Is it possible?
How can I set my Activity to be the default launcher in ADB?

Adding app launch icon to the home screen

I would like to place the app launch icon on the home screen once the user installs my android app. This should be done even if the user does not open the app.
I have tried adding "category android:name="android.intent.category.HOME" in the manifest file for my main activity. But this does not work.
Any pointers on how solve this issue?
Thanks
Srao
I think this would be enough:
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Categories

Resources