universal7885: parts: fix NullPointerException

* "this" to get current context needs to be done on overriding method
This commit is contained in:
Soo-Hwan Na 2021-12-02 06:43:33 +09:00 committed by roynatech2544
commit b65bfd3ba3
No known key found for this signature in database
GPG key ID: 9675C32163D88D30

View file

@ -21,10 +21,11 @@ import android.service.quicksettings.TileService
// TODO: Add FPS drawables
class FPSTileService : TileService() {
private val fpsinfo = Intent(this, FPSInfoService::class.java)
private lateinit var fpsinfo : Intent
private var isShowing = false
override fun onStartListening() {
super.onStartListening()
fpsinfo = Intent(this, FPSInfoService::class.java)
val fpsInfoService = FPSInfoService()
isShowing = fpsInfoService.getRunning()
updateTile()
@ -42,4 +43,4 @@ class FPSTileService : TileService() {
if (isShowing) Tile.STATE_ACTIVE else Tile.STATE_INACTIVE
tile.updateTile()
}
}
}