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. How to set ImageView from internal storage (or SDCard)

Hi,
my app displays some pictures I want to replace at certain intervals by
downloading them from a webpage.
I can set the image from my drawable folder, assets folder or by downloading
it from a webpage:

ImageView im = (ImageView) findViewById(R.id.SplashLogo);
                // url = "file:///android_asset/pic.png";
InputStream is = (InputStream) new URL(url).getContent();
Drawable d = Drawable.createFromStream(is, "src name");

What I want, however, is to display an image that I downloaded previously to
internal storage (or sdcard if i have to).
So: How do set the filename/folder to point to internal storage?

Thanks,
Stephan

-- 

2. 100 chances to win Google IO tickets

http://googlecode.blogspot.com/2011/03/last-call-for-google-io.html

Read this blog entry by Vic Gundotra: "Last Call for Google I/O"

-John Coryat

-- 

3. How to get "arrow icon" selector between two fragments.

4. Phone gap

5. TextView gravity off on Galaxy Tab?

6. how to integrate s/w codec like h/w codec (omx plugin) into stagefright

7. Masih bingung pilih HH