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. Spacing between two LinearLayouts - How to achieve it with XML?


At the moment I'm using the following layout.

Module one and two get added in code. Now I'd like to have a 10px
spacing between the two modules. I have tried to set
"layout_topMargin" to the parent LinearLayout but it doesn't work. In
addition I have tried to set this parameter to the LinearLayout
modules. But well it doesn't work. It always looks like this:   (the two
modules are surrounded by a border)

Do I really have to put a dummy (spacer) view between the two
LinearLayouts or is there another possibility?

Regards and thanks for your help.

2. Adding new contacts from an application


I am writing an application from which I need to update and write new
contacts to Contact database.

what would be the best way to do this?
i have read several posts in which people have tried doing this but
could not not succeed, so has anybody successfully done this?


3. Adding record to Content Provider

4. android security software/malware softwar

5. CHROOT problem

6. changing string resources

7. surfaceflinger different layers