Skip to content

Instantly share code, notes, and snippets.

@pedrovgs
Created March 23, 2015 14:54
Show Gist options
  • Save pedrovgs/c424fe754a74f326e997 to your computer and use it in GitHub Desktop.
Save pedrovgs/c424fe754a74f326e997 to your computer and use it in GitHub Desktop.
Configure your Activity to be opened when the user taps home button with a long press action.
<activity android:name="AwesomeActivity">
<intent-filter>
<action android:name="android.intent.action.ASSIST"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<meta-data
android:name="com.android.systemui.action_assist_icon"
android:resource="@drawable/app_icon"/>
</activity>
@fi8er1
Copy link

fi8er1 commented Sep 7, 2022

What's the usecase for this?

@tethridge
Copy link

The use case is if you want to create your own "assistant", like Gemini or Google Assistant. This allows your application to be configured as the default assistant so that it is opened when the user long presses the power button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment