Android 媒体播放服务绑定(bind)导致 SecurityException?

标签 android security exception binding

在android 4.0.3中绑定(bind)MediaPlaybackService时抛出如下异常:

03-09 09:51:08.399: 错误/AndroidRuntime(664): java.lang.RuntimeException: 无法启动 Activity ComponentInfo{com.sudarmuthu.android.adjustvolume/com.sudarmuthu.android.adjustvolume.AdjustVolume}: java.lang.SecurityException:不允许绑定(bind)到服务 Intent { cmp=com.android.music/.MediaPlaybackService } 03-09 09:51:08.399:错误/AndroidRuntime(664):在 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) 03-09 09:51:08.399:错误/AndroidRuntime(664):在 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 03-09 09:51:08.399:错误/AndroidRuntime(664):在 android.app.ActivityThread.access$600(ActivityThread.java:123) 03-09 09:51:08.399: 错误/AndroidRuntime (664): 在 android.app.ActivityThread$H.handleMessage (ActivityThread.java:1147) 03-09 09:51:08.399: 错误/AndroidRuntime (664): 在 android.os.Handler.dispatchMessage (Handler.java:99) 03-09 09:51:08.399: 错误/AndroidRuntime (664): 在 android.os.Looper.loop (Looper.java:137) 03-09 09:51:08.399: 错误/AndroidRuntime (664): 在 android.app.ActivityThread.main (ActivityThread.java:4424) 03-09 09:51:08.399:错误/AndroidRuntime(664):在 java.lang.reflect.Method.invokeNative( native 方法) 03-09 09:51:08.399: 错误/AndroidRuntime (664): 在 java.lang.reflect.Method.invoke (Method.java:511) 03-09 09:51:08.399:错误/AndroidRuntime(664):在 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 03-09 09:51:08.399: 错误/AndroidRuntime (664): 在 com.android.internal.os.ZygoteInit.main (ZygoteInit.java:551) 03-09 09:51:08.399:错误/AndroidRuntime(664):在 dalvik.system.NativeStart.main( native 方法) 03-09 09:51:08.399: ERROR/AndroidRuntime(664): Caused by: java.lang.SecurityException: Not allowed to bind to service Intent { cmp=com.android.music/.MediaPlaybackService } 03-09 09:51:08.399: 错误/AndroidRuntime (664): 在 android.app.ContextImpl.bindService (ContextImpl.java:1135) 03-09 09:51:08.399: 错误/AndroidRuntime (664): 在 android.content.ContextWrapper.bindService (ContextWrapper.java:370) 03-09 09:51:08.399:错误/AndroidRuntime(664):在 com.sudarmuthu.android.adjustvolume.AdjustVolume.onStart(AdjustVolume.java:153) 03-09 09:51:08.399: 错误/AndroidRuntime (664): 在 android.app.Instrumentation.callActivityOnStart (Instrumentation.java:1133) 03-09 09:51:08.399:错误/AndroidRuntime(664):在 android.app.Activity.performStart(Activity.java:4475) 03-09 09:51:08.399:错误/AndroidRuntime(664):在 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1929)

本应用在android 2.1版本中流畅运行。

任何帮助!!

最佳答案

关于Android 媒体播放服务绑定(bind)导致 SecurityException?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9628927/

相关文章:

security - Firefox 不建议信用卡号码

javaws 系统属性放宽或删除安全?

java - 长 Java 'try' block 中的哪一行抛出异常?

java - 从 Kotlin 调用 Java 编写的抛出异常的方法时,如何实现空安全?

sql - H2中通过PreparedStatement查询抛出异常: This method is not allowed for a prepared statement; use a regular statement instead

java - 按名称获取 ArrayList<NameValuePair> 值

android - ActionBarSherlock:如何访问主页按钮 View ?

android - Android应用程序中静态数据的存储

android - 谷歌警告开发者为 Android 应用程序包含 64 位版本

.net - 安全密码哈希