3

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!

2 Answers 2

7

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".

Sign up to request clarification or add additional context in comments.

1 Comment

Finally I found an answer! But what about onProvideAssistContent? Why isn't it triggered? This filter triggers my onCreate
2

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.

1 Comment

Thought so, just needed confirmation. Thank you very much, very helpful!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.