I has encounter the same question.I also can't clear missed call
notifications on 2.2 ,but not on 2.3.do you archieve the solution? if
yes,help me please ! think you!
On Wednesday, December 29, 2010 9:48:09 PM UTC+8, Thomas Tong wrote:
>
> Hi, all
> I tried to clear missed call notification in my application. It
> works great in android2.2.1. But it can't work for Android2.3. The
> error is reported out as below. And I make sure I had added this
> line(<uses-permission
> android:name="android.permission.MODIFY_PHONE_STATE" />
> ) in AndroidManifest.xml. Would you like to point out what wrong it
> is? Thank you very much in advance.
> try {
> ITelephony iTelephony =
>
> ITelephony.Stub.asInterface(ServiceManager.getService("phone"));
> if (iTelephony != null) {
> iTelephony.cancelMissedCallsNotification();
> } else {
> Log.w(TAG, "Telephony service is null, can't call
> " +
> "cancelMissedCallsNotification");
> }
> } catch (RemoteException e) {
> Log.e(TAG, "Failed to clear missed calls notification
> due to remote exception");
> }
>
>
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): FATAL EXCEPTION: main
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995):
> java.lang.RuntimeException: Unable to start activity
> ComponentInfo{com.lianyun.data/com.lianyun.data.Entry}:
> java.lang.SecurityException: Neither user 10037 nor current process
> has android.permission.MODIFY_PHONE_STATE.
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 1622)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> 1638)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> android.app.ActivityThread.access$1500(ActivityThread.java:117)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> android.os.Looper.loop(Looper.java:123)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> android.app.ActivityThread.main(ActivityThread.java:3647)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> java.lang.reflect.Method.invokeNative(Native Method)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> java.lang.reflect.Method.invoke(Method.java:507)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:839)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> dalvik.system.NativeStart.main(Native Method)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): Caused by:
> java.lang.SecurityException: Neither user 10037 nor current process
> has android.permission.MODIFY_PHONE_STATE.
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> android.os.Parcel.readException(Parcel.java:1322)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> android.os.Parcel.readException(Parcel.java:1276)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> com.android.internal.telephony.ITelephony$Stub
> $Proxy.cancelMissedCallsNotification(ITelephony.java:671)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> com.lianyun.data.Entry.onCreate(Entry.java:80)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> 1047)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> 1586)
> 12-29 13:41:32.656: ERROR/AndroidRuntime(995): ... 11 more
>
--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.