mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 19:34:15 +01:00
prevent crash
This commit is contained in:
@@ -56,14 +56,18 @@ public class ServiceTileUnseen extends TileService {
|
||||
Log.i("Update tile unseen=" + unseen);
|
||||
|
||||
Tile tile = getQsTile();
|
||||
if (tile != null) {
|
||||
tile.setState(unseen > 0 ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
||||
tile.setIcon(Icon.createWithResource(ServiceTileUnseen.this,
|
||||
unseen > 0 ? R.drawable.baseline_mail_24 : R.drawable.baseline_mail_outline_24));
|
||||
tile.setLabel(getResources().getQuantityString(
|
||||
R.plurals.title_tile_unseen, unseen, unseen));
|
||||
tile.updateTile();
|
||||
}
|
||||
if (tile != null)
|
||||
try {
|
||||
tile.setState(unseen > 0 ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
|
||||
tile.setIcon(Icon.createWithResource(ServiceTileUnseen.this,
|
||||
unseen > 0 ? R.drawable.baseline_mail_24 : R.drawable.baseline_mail_outline_24));
|
||||
tile.setLabel(getResources().getQuantityString(
|
||||
R.plurals.title_tile_unseen, unseen, unseen));
|
||||
tile.updateTile();
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
// See ServiceTileSynchronize
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user