我已经为 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)