mirror of
https://github.com/home-assistant/android
synced 2024-07-22 10:54:12 +00:00
Fix unable to Toast on QS tiles being clicked error (#2776)
* Fix unable to Toast on QS tiles being clicked error * Review comments
This commit is contained in:
parent
03a356f147
commit
d3c22cf341
|
@ -149,8 +149,14 @@ abstract class TileExtensions : TileService() {
|
|||
Log.d(TAG, "Service call sent for tile ID: $tileId")
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Unable to call service for tile ID: $tileId", e)
|
||||
Toast.makeText(context, commonR.string.service_call_failure, Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
withContext(Dispatchers.Main) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
commonR.string.service_call_failure,
|
||||
Toast.LENGTH_SHORT
|
||||
)
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
tile.state = Tile.STATE_INACTIVE
|
||||
|
@ -159,7 +165,14 @@ abstract class TileExtensions : TileService() {
|
|||
tile.state = Tile.STATE_UNAVAILABLE
|
||||
tile.updateTile()
|
||||
Log.d(TAG, "No tile data found for tile ID: $tileId")
|
||||
Toast.makeText(context, commonR.string.tile_data_missing, Toast.LENGTH_SHORT).show()
|
||||
withContext(Dispatchers.Main) {
|
||||
Toast.makeText(
|
||||
context,
|
||||
commonR.string.tile_data_missing,
|
||||
Toast.LENGTH_SHORT
|
||||
)
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue