long press quick setting tile in android

为君一笑 提交于 2019-12-06 07:18:09

问题


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:


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>


来源:https://stackoverflow.com/questions/42723188/long-press-quick-setting-tile-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!