Xamarin - “Android.Content.IntentFilter”不是属性 class
Xamarin - ‘Android.Content.IntentFilter' is not an attribute class
我创建了一个 Android class 库,其中包含广播接收器的实现:
[IntentFilter(new string[] { "com.google.android.gcm.intent.RETRY" }, Categories = new string[] { "@PACKAGE_NAME@"})]
public class GcmBroadcastReceiver : BroadcastReceiver
{
public GcmBroadcastReceiver ()
{
}
}
当我尝试构建时收到消息“‘Android.Content.IntentFilter’不是属性 class”
我需要做什么来构建这个版本?
您需要为 Android.Content 和 Android.App
添加 using 语句
我创建了一个 Android class 库,其中包含广播接收器的实现:
[IntentFilter(new string[] { "com.google.android.gcm.intent.RETRY" }, Categories = new string[] { "@PACKAGE_NAME@"})]
public class GcmBroadcastReceiver : BroadcastReceiver
{
public GcmBroadcastReceiver ()
{
}
}
当我尝试构建时收到消息“‘Android.Content.IntentFilter’不是属性 class”
我需要做什么来构建这个版本?
您需要为 Android.Content 和 Android.App
添加 using 语句