0

我已经为 android.intent.action.CALL_BUTTON 注册了 MyBroadcastReceiver 。当我运行程序时,我在 LogCat 中收到 ServiceConnectionLeaked 错误。

public class MyBroadcastReceiver extends BroadcastReceiver {


   @Override
   public void onReceive(Context context, Intent intent) {

       Toast.makeText(context, "Intent Detected.", Toast.LENGTH_LONG).show(); 


   }

}

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.collabera.labs.sai"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
         <receiver android:name=".MyBroadcastReceiver"> 
      <intent-filter>
         <action android:name="android.intent.action.CALL_BUTTON">  
      </action>
      </intent-filter>
   </receiver> 
    </application>
    <uses-sdk android:minSdkVersion="8" />
</manifest> 

错误

10-05 07:13:54.640: D/ExchangeService(1527): !!! Email application not found; stopping self
10-05 07:13:54.640: W/Trace(1527): Unexpected value from nativeGetEnabledTags: 0
10-05 07:13:54.640: W/Trace(1527): Unexpected value from nativeGetEnabledTags: 0
10-05 07:13:54.640: E/ActivityThread(1527): Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@b5020060 that was originally bound here
10-05 07:13:54.640: E/ActivityThread(1527): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@b5020060 that was originally bound here

    10-05 06:34:41.205: E/ActivityThread(1527):     at java.lang.Thread.run(Thread.java:856)
    10-05 06:34:41.215: E/StrictMode(1527): null
    10-05 06:34:41.215: E/StrictMode(1527): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@b5064ec8 that was originally bound here
    10-05 06:34:41.215: E/StrictMode(1527):     at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
    10-05 06:34:41.215: E/StrictMode(1527):     at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
    10-05 06:34:41.215: E/StrictMode(1527):     at android.app.ContextImpl.bindService(ContextImpl.java:1418)
4

1 回答 1

0

在你的模拟器中。设置-> 应用程序。在该滑动到“所有”应用程序中,您可以找到“Exchange 服务”,打开它并禁用。希望你不会得到那个错误

于 2013-10-05T07:03:39.683 回答