kevdliu
kevdliu

Reputation: 1819

how to make android app launch from long-pressing search button?

I have been trying to enable my app to launch from long pressing the search button on the phone.

How can this be done?

Thanks!

Upvotes: 0

Views: 861

Answers (1)

hooked82
hooked82

Reputation: 6376

Try setting this intent-filter on your Activity that you would like to show when the user long clicks the search button:

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

Upvotes: 2

Related Questions