这是我的manifest.xml
文件的摘录:
<receiverandroid:name=".SmsReceiver">
<intent-filter>
<actionandroid:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
编译代码时,我在控制台中收到以下错误:
Element type "receiverandroid:name" must be followed by either attribute specifications, ">" or "/>"
这实际上不是我做的吗?为什么我会收到此错误?
答案 0 :(得分:3)
在<receiverandroid:name
和<actionandroid:name
<receiver android:name=".SmsReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
答案 1 :(得分:2)
将您的接收者声明为:
<receiver android:name=".SmsReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
目前您组合了标记名称和属性。在标签和属性之间留出空间