Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin - ‘Android.Content.IntentFilter' is not an attribute class

I’ve created an Android class library that includes an implementation of a broadcast receiver:

[IntentFilter(new string[] { "com.google.android.gcm.intent.RETRY" }, Categories = new string[] { "@PACKAGE_NAME@"})]
public class GcmBroadcastReceiver : BroadcastReceiver
{
    public GcmBroadcastReceiver ()
    {

    }
}

When I try to build I’m getting the message “‘Android.Content.IntentFilter' is not an attribute class”

What do I need to do to make this build?

like image 876
Chris HG Avatar asked Dec 11 '22 23:12

Chris HG


1 Answers

You need to add using statements for both Android.Content and Android.App

like image 69
Adam Diament Avatar answered Feb 20 '23 02:02

Adam Diament