Bug 23980 - Integer cast required for Notification.Builder.SetPriority()
Summary: Integer cast required for Notification.Builder.SetPriority()
Alias: None
Product: Android
Classification: Xamarin
Component: Pre-release ()
Version: 4.18.0
Hardware: Macintosh Mac OS
: --- minor
Target Milestone: 4.20
Assignee: Atsushi Eno
Depends on:
Reported: 2014-10-21 19:48 UTC by Mark McLemore
Modified: 2014-11-06 06:10 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Mark McLemore 2014-10-21 19:48:23 UTC
Using Notification.Builder to create a notification for the Android L Preview.
Xamarin.Android 4.99.0 - Android 4.5, API level 21.

When I enter the following code in Xamarin Studio, I get a compile error -- it doesn't like the enums: "The best overloaded method match for 'Android.App.Notification.Builder.SetPriority(int) has some invalid arguments (CS1502)":


However, I can cast the enum to int to get it to work:


Shouldn't SetPriority accept NotificationPriority enums without a typecast?  After all, SetPriority is Xamarin code, so it seems like it should accept Xamarin-defined enums.
Comment 1 Atsushi Eno 2014-10-30 23:14:00 UTC
Yes you're right. Now it is fixed in our sources. Thanks for the report.

[master 2d47811]
Comment 2 Sadik Ali 2014-11-06 06:10:24 UTC
I have checked this issue with following builds :

Mac OS X 10.9.5
Xamarin Studio: 5.5.4 (build 11)
Mono 3.10.0 ((detached/ec8eadc)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Android : (Enterprise Edition)
=== Build Information ===
Release ID: 505040011
Git revision: eeee7455222308275e32ba67790c0b42d904292b
Build date: 2014-11-04 19:49:29-05
Xamarin addins: 53c87071a252e02e7bc7a80bf735b9fd4a89339d

I have checked the definition of "SetPriority" method of "Builder" class in assembly browser and observed that now SetPriority accept NotificationPriority enums.

Screencast: http://screencast.com/t/k1dbLAu020

This issue has been fixed. Hence, I am closing this issue.