[android] - use default icon when compass icon fails to decode (#10694)
This commit is contained in:
@@ -191,6 +191,12 @@ public final class UiSettings {
|
||||
}
|
||||
|
||||
private Drawable decode(byte[] bitmap) {
|
||||
if (bitmap == null) {
|
||||
// return default icon
|
||||
return compassView.getResources().getDrawable(R.drawable.mapbox_compass_icon);
|
||||
}
|
||||
|
||||
// try decoding saved bitmap
|
||||
Bitmap compass = BitmapFactory.decodeByteArray(bitmap, 0, bitmap.length);
|
||||
return new BitmapDrawable(compassView.getResources(), compass);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user