首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >短信接收权限AndroidManifest.xml中的基本错误

短信接收权限AndroidManifest.xml中的基本错误
EN

Stack Overflow用户
提问于 2015-09-12 09:15:13
回答 7查看 9.5K关注 0票数 5

我知道这已经被问了十几次了,但是我仍然得到了这个xml配置的权限错误。我已经仔细研究了关于这个问题的其他答复。我正在使用API级别23。谁能指出这个错误吗?错误是显而易见的:

09-12 09:13:40.016 1295-1309/?W/BroadcastQueue:权限拒绝:对com.example.richard.simplesmstoast/.SmsReceiver的接收意图{ act=android.provider.Telephony.SMS_RECEIVED flg=0x8000010 (有额外的)}需要android.permission.RECEIVE_SMS,因为发送方com.android.phone (uid 1001)

代码语言:javascript
运行
复制
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <receiver
        android:name=".SmsReceiver"
        android:enabled="true"
        android:exported="true">
        <intent-filter android:priority="999" >
            <action android:name="android.provider.Telephony.SMS_RECEIVED" />
        </intent-filter>
    </receiver>
</application>

<uses-permission android:name="android.permission.RECEIVE_SMS"/>

EN

Stack Overflow用户

发布于 2015-09-14 12:17:11

这对我有效..。看看这个也许会对你有帮助

代码语言:javascript
运行
复制
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Holo.Light.DarkActionBar" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <receiver android:name="packageName" >
        <intent-filter >

            <action android:name="android.provider.Telephony.SMS_RECEIVED" />
        </intent-filter>

    </receiver>
</application>

票数 -1
EN
查看全部 7 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32537156

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档