Brian
Brian

Reputation: 8085

Overriding Search Long Press

On many Android phones, when a user long presses the Search button, it launches the Google Voice Search intent. How can override this feature across the entire system, not just overriding Search button long presses from an activity? More specifically, how can I add my app to be the same type of intent as Google Voice Search so that it shows up as a "Choose Application" option when the Search button is long pressed. Thanks a lot!

Upvotes: 0

Views: 2094

Answers (1)

dymmeh
dymmeh

Reputation: 22306

Try using "android.intent.action.SEARCH_LONG_PRESS" as your action with the category as "android.intent.category.DEFAULT" under your intent-filters in your AndroidManifest.xml

<application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".YourActivityName" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.SEARCH_LONG_PRESS" />
                <category android:name="android.intent.category.DEFAULT" /> 
            </intent-filter>
        </activity>

    </application>

Upvotes: 3

Related Questions