summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android/Platform.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.Android/Platform.cs')
-rw-r--r--Xamarin.Forms.Platform.Android/Platform.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.Android/Platform.cs b/Xamarin.Forms.Platform.Android/Platform.cs
index 3334ba6e..29af59f7 100644
--- a/Xamarin.Forms.Platform.Android/Platform.cs
+++ b/Xamarin.Forms.Platform.Android/Platform.cs
@@ -361,8 +361,8 @@ namespace Xamarin.Forms.Platform.Android
IMenuItem menuItem = menu.Add(item.Text);
if (!string.IsNullOrEmpty(item.Icon))
{
- Drawable iconBitmap = _context.Resources.GetDrawable(item.Icon);
- if (iconBitmap != null)
+ var iconBitmap = new BitmapDrawable(_context.Resources, ResourceManager.GetBitmap(_context.Resources, item.Icon));
+ if (iconBitmap != null && iconBitmap.Bitmap != null)
menuItem.SetIcon(iconBitmap);
}
menuItem.SetEnabled(controller.IsEnabled);
@@ -948,7 +948,10 @@ namespace Xamarin.Forms.Platform.Android
FileImageSource titleIcon = NavigationPage.GetTitleIcon(view);
if (!string.IsNullOrWhiteSpace(titleIcon))
{
- actionBar.SetLogo(_context.Resources.GetDrawable(titleIcon));
+ var iconBitmap = new BitmapDrawable(_context.Resources, ResourceManager.GetBitmap(_context.Resources, titleIcon));
+ if (iconBitmap != null && iconBitmap.Bitmap != null)
+ actionBar.SetLogo(iconBitmap);
+
useLogo = true;
showHome = true;
showTitle = true;