I am developing lock screen application for that i need to disable the home button.
some one told to me kept in the manifest as category as default, home but when ever device boot completed my activity launches but not finishing.because I my application is home How to handle the Home button.How Go locker application handled Home button
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
please give me a proper suggestion i would very thankful to you.
You need to add:
<category android:name="android.intent.category.LAUNCHER" />
so your full intent-filter section looks like this:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Not this still won't FORCE the app to run at boot. This will just add it to the list of launchers. It will only launch at boot if the user chooses it as their default launcher.
If you want to run an activity at launch, you can register a broadcast receiver to handle the ON_BOOT_COMPLETED action, but think very carefully before doing so; is this what all users of your app would want?
Related
I want my app to handle the HOME key press with a custom action, and also stay in the foreground. I put the following code in AndroidManidest.xml:
<activity
...
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
....
</intent-filter>
</activity>
However, this has set my app as the new home screen, which I don't want. I only want to capture the key press while my app is in the foreground, just like you can capture other buttons. Is there any way to do that? Perhaps set the intent filter to only work while my app is in the foreground?
I am developing an app for watch, which should have its own phone call UI.
Sadly, we can only use hardware buttons to interact with app. Whenever I make a call with my activity that manages all the phone logic, it works as expected, but I want to show also a screen with info "Call ended".
The problem is that user can only end call by using hardware button that is also a home button of our watch. I wonder if there is a way that home button would not interrupt CallActivity? Cause what is happening now is that the "Call ended" screen is showing up for a very short period of time and I believe that is caused by launching Main Activity by home button.
I believe if that is a matter of activities, AndroidManifest pieces might be useful:
<activity android:name=".CallActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
If I click home button when MainActivity is on, it just works as expected, not launching MainActivity over and over.
Can you actually make CallActivity ignore home button just the same way?
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
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
I'm building an alternative Home application (a replacement of the standard launcher).
There's something I don't know how to make : how do you register your application so that it is called when the user click on the Home hard button ?
It all depends on intent filter:
<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>