has leaked service connection in activity that was originally bound here

by mawei1981 » Wed, 29 Apr 2009 16:25:47 GMT


Sponsored Links
 hen I bind service when activity on create:




04-29 16:20:27.797: ERROR/ActivityThread(11629): Activity
com.maweis.ToggleSilentActivity has leaked ServiceConnection
com.maweis.togglesilentactivit...@434fffa0 that was originally bound
here
04-29 16:20:27.797: ERROR/ActivityThread(11629):
android.app.ServiceConnectionLeaked: Activity
com.maweis.ToggleSilentActivity has leaked ServiceConnection
com.maweis.togglesilentactivit...@434fffa0 that was originally bound
here
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
android.app.ActivityThread$PackageInfo$ServiceDispatcher.<init>
(ActivityThread.java:886)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
android.app.ActivityThread$PackageInfo.getServiceDispatcher
(ActivityThread.java:781)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
android.app.ApplicationContext.bindService(ApplicationContext.java:
820)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
android.content.ContextWrapper.bindService(ContextWrapper.java:307)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
com.maweis.ToggleSilentActivity.onCreate(ToggleSilentActivity.java:
153)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2231)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2284)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
android.os.Handler.dispatchMessage(Handler.java:99)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
android.os.Looper.loop(Looper.java:123)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
android.app.ActivityThread.main(ActivityThread.java:3948)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
java.lang.reflect.Method.invokeNative(Native Method)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
java.lang.reflect.Method.invoke(Method.java:521)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
04-29 16:20:27.797: ERROR/ActivityThread(11629): at
dalvik.system.NativeStart.main(Native Method)




code:

private ToggleSilentService serviceBinder;

private ServiceConnection mConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName className, IBinder
service) {
serviceBinder = ((ToggleSilentService.MyBinder) service)
.getService();
}

public void onServiceDisconnected(ComponentName className) {
serviceBinder = null;
}
};

@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
mSensorManager = (SensorManager) getSystemService
(Context.SENSOR_SERVICE);



Other Threads

1. bug in Spinner.setSelection when called twice?

Hi,

I think i found the solution: a call to
ArrayAdapter<CharSequence>.notifyDataSetChanged fixed the problem.

Thierry.


2010/2/3 Thierry Legras <tleg...@gmail.com>



> 

2. Background on layout is scrunching contained content

Without seeing your code it's hard to know what's going on, but
background drawables are never drawn in the foreground.







> 

3. Ebook yang bagus

4. persisting application data that will remain after app removal

5. persisting application data that will remain after app removal

6. Problems with Activity Flow during OAUTH Authentication

7. New activity instance created for every intent-filter?