ServiceTitle
来源:互联网 发布:万方数据库论文查重 编辑:程序博客网 时间:2024/06/06 19:06
android.service.quicksettings.TileService
/**
* A TileService provides the user a tile that can be added to Quick Settings.* Quick Settings is a space provided that allows the user to change settings and
* take quick actions without leaving the context of their current app.
*
* <p>The lifecycle of a TileService is different from some other services in
* that it may be unbound during parts of its lifecycle. Any of the following
* lifecycle events can happen indepently in a separate binding/creation of the
* service.</p>
*TitleService的生命周期和其他Service的不一样,它会在任意一个生命阶段unbound(解绑)。生命周期中的任意一个阶段可以
* 独立的发生在一个不同的Service 实例中。
*
*
* <ul>
* <li>When a tile is added by the user its TileService will be bound to and
* {@link #onTileAdded()} will be called.</li>
*当一个title被用户添加了,它的TitleService将会被绑定并回调onTileAdded()。
*
*
* <li>When a tile should be up to date and listing will be indicated by
* {@link #onStartListening()} and {@link #onStopListening()}.</li>
*当title需要更新,列表将由onStartListening()和onStopListening()通知。
*
*
* <li>When the user removes a tile from Quick Settings {@link #onTileRemoved()}
* will be called.</li>
* 当一个title从快速设定中移除,onTileRemoved()会被回调
*
* </ul>
* <p>TileService will be detected by tiles that match the {@value #ACTION_QS_TILE}
* and require the permission "android.permission.BIND_QUICK_SETTINGS_TILE".
* The label and icon for the service will be used as the default label and
* icon for the tile. Here is an example TileService declaration.</p>
* <pre class="prettyprint">
* TitleService将会被识别如果匹配ACTION_QS_TILE,而且要permisson "android.permission.BIND_QUICK_SETTINGS_TILE"
* service配置文件中的label和icon会作为快速设定中显示的标题和图标。下面是啊一个例子
* {@literal
* <service
* android:name=".MyQSTileService"
* android:label="@string/my_default_tile_label"
* android:icon="@drawable/my_default_icon_label"
* android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
* <intent-filter>
* <action android:name="android.service.quicksettings.action.QS_TILE" />
* </intent-filter>
* </service>}
* </pre>
*
* @see Tile Tile for details about the UI of a Quick Settings Tile.
*/
http://blog.csdn.net/yulianlin/article/details/52367246
0 0