Android SecurityException权限拒绝READ_SMS

时间:2015-04-23 20:55:55

标签: android permissions

我实际上正在制作一个简单的应用程序,它从手机读取短信,然后将其中一个发送到另一部手机。

我在Android Studio中重新创建了this project。代码没有任何类似的错误,但如果我启动它,我的逻辑会发出以下警告:

java.lang.RuntimeException:
Unable to start activity ComponentInfo{com.example.android.fetchinboxsms/
com.example.android.fetchinboxsms.MainActivity}:
java.lang.SecurityException: Permission Denial: 
opening provider com.android.providers.telephony.SmsProvider from 
ProcessRecord{ebd2075 2443:com.example.android.fetchinboxsms/u0a59} (pid=2443, uid=10059) 
requires android.permission.READ_SMS or android.permission.WRITE_SMS

我在Manifest文件中给了READ_SMS权限,为什么会出现这个错误?有什么建议吗?

0 个答案:

没有答案
相关问题