daniel.gindi
daniel.gindi

Reputation: 3496

Is there a way to bind an android app to a long-press of the home button?

I'm looking for an intent-filter, like android.intent.category.HOME, that will allow an app to launch when the HOME button is pressed, only for a long press. Or any other method for achieving the same result... I read that it was possible in the past but was disable for security reasons... is that true?

Thanks!

Upvotes: 3

Views: 1449

Answers (2)

tyolab
tyolab

Reputation: 396

It is doable now since Android 4.1

Simply, add the following and place them inside the main activity element of your AndroidManifest.xml‎

<intent-filter>
    <action android:name="android.intent.action.ASSIST" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

Then reinstall your application, long press the home button your App will be listed in "Complete action with".

Upvotes: 7

CommonsWare
CommonsWare

Reputation: 1007359

I'm looking for an intent-filter, like android.intent.category.HOME, that will allow an app to launch when the HOME button is pressed, only for a long press.

This is not supported by Android, sorry.

Upvotes: 2

Related Questions