can't bind to a local service.

by sdphil » Thu, 10 Sep 2009 02:38:17 GMT

Sponsored Links
 I have the following base activity.

public class BaseActivity extends Activity
... onCreate(...) {
        this.bindService(new Intent(BaseActivity.this,
LocalService.class), serviceConn, Context.BIND_AUTO_CREATE);
    private ServiceConnection serviceConn = new ServiceConnection() {
                public void onServiceConnected(ComponentName name, IBinder 
                        LocalService.LocalBinder binder = 
                        service = binder.getService();

A derived activity fails on the call to cast a binder --

LocalService.LocalBinder binder = (LocalService.LocalBinder) service;

fails with this on the call stack --

InvocationTargetException.<init>(Throwable) line: 56
ActivityThread.main(String[]) line: 3948

what am I doing wrong?


can't bind to a local service.

by Dianne Hackborn » Thu, 10 Sep 2009 03:43:21 GMT

 Did you publish the service in your manifest?

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


Sponsored Links

can't bind to a local service.

by sdphil » Thu, 10 Sep 2009 03:48:43 GMT

 egads!  that was it (well, kinda)

I had it in there, but I had it as remote --



Other Threads

1. awakenScrollBars() not showing scrollBar in custom View


I have a custom view. I am scrolling the view vertically using scrollTo
(int, int). But the scrollbar is not showing when scrolling. I tried
awakenScrollBars(). But its not drawing the scrollbar. I also put
setVerticalScrollBarEnabled(true). Whether I am missing something
here ?



2. Fwd: xor algorithm used when gc in dalvik

Oh! I'm sorry. I made mistakes. I misunderstood the code. Now I made clear.

---------- Forwarded message ----------
From: <>
Date: 2009/12/11
Subject: Re: [android-porting] Re: xor algorithm used when gc in dalvik

In dalvik\vm\alloc\marksweep.c's function:

dvmHeapSweepUnmarkedObjects(int *numFreed, size_t *sizeFreed)

*    dvmHeapBitmapXorWalkLists(markBitmaps, objectBitmaps,
numBitmaps,sweepBitmapCallback, NULL);*
2009/12/11 fadden <>

What bit of code are you looking at?

> website: 

3. Playing Flash file in Android

4. URLconnection.setConnectTimeout doesn't work?

5. xor algorithm used when gc in dalvik

6. lock screen always portrait

7. booting using AutoBoot