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() {
                @Override
                public void onServiceConnected(ComponentName name, IBinder 
service)
{
                        LocalService.LocalBinder binder = 
(LocalService.LocalBinder)
service;
                        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?

tia.
--~--~---------~--~----~------------~-------~--~----~



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
hack...@android.com

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 --
 android:process=":remote"

thanks!




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. awakenScrollBars() not showing scrollBar in custom View

Hi,

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 ?

Thanks

-- 

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: <geelphe...@gmail.com>
Date: 2009/12/11
Subject: Re: [android-porting] Re: xor algorithm used when gc in dalvik
To:


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

dvmHeapSweepUnmarkedObjects(int *numFreed, size_t *sizeFreed)
{
...


*    dvmHeapBitmapXorWalkLists(markBitmaps, objectBitmaps,
numBitmaps,sweepBitmapCallback, NULL);*
...
}
2009/12/11 fadden <fad...@android.com>

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