When you use META_DATA_ACTIVE_TILE, onStartListening() TileService callback, which updates Tile state will fire when you call TileService.requestListeningState().
It works, but when the device boots, Tile is in ACTIVE state until you click it. If ACTIVE_TILE not set the tile stays in INACTIVE state on boot.
How to solve it?
Android 7.1.2
I think the documentation is not that clear in this case. I was having the same problem, and after several tries I found a solution for my case.
The manifest stays:
<meta-data android:name="android.service.quicksettings.ACTIVE_TILE"
android:value="true" />
And then in the quickTileService override onBind and call RequestListeningState:
override fun onBind(intent: Intent?): IBinder {
TileService.requestListeningState(this,
ComponentName(this, QSTileService::class.java))
return super.onBind(intent)
}
And on the onStartListening you can update your tile:
override fun onStartListening() {
super.onStartListening()
updateTile()
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With