android home application not starting after reboot why? - android

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"

Related

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>

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?

My android application always be in launcher list

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

How can my Launcher deploy default launcher choice window?

I had an android launcher project. After installed on my phone, pressing HOME will NOT make the "default launcher choise" popwindow showing to choose default launcher.
following is related setting:
<activity
android:name="MyLauncherActivity"
.....
.....
<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>
</activity>
how can I make that popupWindow show ?
P.S How curiouse it is! I just restart Eclipse and reinstall it, pressing HOME make the default launcher choise popupwindow showing!
<category android:name="android.intent.category.LAUNCHER" />
in your activity intent-filter means this is the start point of the app, when the user clicks on the app icon, will run this activity ( it doesn't mean this activity is a launcher app)
and you are looking for this:
How to make a launcher

How to end a launcher completely?

My application works as a launcher. But, I guess I did something wrong by making it a launcher. For instance, the user selects my application as Default Launcher (clicks 'Always'). However, when the user exits from the application, it appears again, because it's the default launcher. How can I fix it?
<activity
android:name="com.comeks.cocuktablet.Main"
android:label="#string/app_name"
android:launchMode="singleInstance"
android:screenOrientation="portrait" >
<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.LAUNCHER" />
</intent-filter>
</activity>
The code comes from my manifest. I also want to make MAIN activity launcher.
Edit:
I realized my exact error. I also wrote a code to start my app on boot. The problem is that when I close my device and open it again, I cannot exit from it.
Thank you for your all answers. I solved my problem by calling Android's home launcher while exiting from app.
Just remove
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
from intent-filter

Categories

Resources