zoukankan      html  css  js  c++  java
  • Android 开发之错误整理java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10088 nor current process has android.permission.READ_PHONE_STATE.

    java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10088 nor current process has android.permission.READ_PHONE_STATE.
     
    今天写了一款发短信的软件,拿了个酷派5879,试了下,结果不能用,把try{}catch{}去掉了,报这个错误,
    android.permission.READ_PHONE_STATE.没有READ_PHONE_STATE权限,于是在manifest.xml中添加权限。
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />  
    再次运行可以了。
     
    错误日志:
     
    04-28 22:23:07.862: E/Trace(26834): error opening trace file: No such file or directory (2)
    04-28 22:23:18.152: E/AndroidRuntime(26834): FATAL EXCEPTION: main
    04-28 22:23:18.152: E/AndroidRuntime(26834): java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10088 nor current process has android.permission.READ_PHONE_STATE.
    04-28 22:23:18.152: E/AndroidRuntime(26834): at android.os.Parcel.readException(Parcel.java:1425)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at android.os.Parcel.readException(Parcel.java:1379)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at com.android.internal.telephony.ISms$Stub$Proxy.sendText(ISms.java:736)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at android.telephony.SmsManager.sendTextMessage(SmsManager.java:88)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at com.dava.helpmywife.sendMessage.sendMessage(sendMessage.java:36)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at com.dava.helpmywife.inits$3.onClick(inits.java:82)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:171)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at android.os.Handler.dispatchMessage(Handler.java:99)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at android.os.Looper.loop(Looper.java:137)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at android.app.ActivityThread.main(ActivityThread.java:4802)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at java.lang.reflect.Method.invokeNative(Native Method)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at java.lang.reflect.Method.invoke(Method.java:511)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
    04-28 22:23:18.152: E/AndroidRuntime(26834): at dalvik.system.NativeStart.main(Native Method) 
    一步一步行走,做好每一件事情。
  • 相关阅读:
    HTTP与HTTPS
    各种排序算法的比较
    数据结构之堆排序
    数据结构之希尔排序
    快速排序与归并排序的区别与联系
    数据结构之快速排序
    DVWA-4.3 File Inclusion(文件包含)-High-利用file协议绕过防护策略
    DVWA-4.2 File Inclusion(文件包含)-Medium-双写绕过str_replace替换规则
    DVWA-4.1 File Inclusion(文件包含)-Low
    DVWA-3.4 CSRF(跨站请求伪造)-Impossible
  • 原文地址:https://www.cnblogs.com/dava/p/3698126.html
Copyright © 2011-2022 走看看