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. PhoneFactory.getDefaultPhone from apps other than PhoneApp

This is not a public API, so it can't.








-- 
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.

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

2. How to get the source code of Google maps for android sdk 1.5

Hi, everybody

Do anybody know how can I get the source code of Google maps for
android sdk1.5, if the version of Google maps for android sdk 1.5 is
same with the version of Google maps for android sdk 1.0? Can I build
the source code of Google map v1.0 with the source code of sdk 1.5 to
a same imge?

Best Regards

Taro

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

3. Populating a Spinner from another Spinner Dynamically

4. How to set the http proxy in the real device

5. Android article research - Help needed

6. Android Contacts app does not include website address for contacts

7. Looking for a co-founder