long press quick setting tile in android

2019-06-08 06:53发布

I am new to android development. Trying to make a tile service, but I have trouble to overriding the default long press action.

For that, I have a class called QSTileService which extends TileService, and I want my tile to do different things depending on if you press or long press it. what ive found so far with buttons is to implement the OnLongClickListener interface and fill in what you want to do in the onLongClick method, but im not sure how to do this with quick setting tiles?

any help will be appreciated

1条回答
做个烂人
2楼-- · 2019-06-08 07:36

as per Documentation:

Long clicking on your quick settings tile will, by default, go to your app’s info screen. You can override that behavior by adding an intent-filter to one of your activities like so:

<intent-filter>
    <action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES"/>
</intent-filter>
查看更多
登录 后发表回答