onServiceConnected never called after bindService method
Posted
by Tobia Loschiavo
on Stack Overflow
See other posts from Stack Overflow
or by Tobia Loschiavo
Published on 2010-03-21T10:26:32Z
Indexed on
2010/03/21
10:31 UTC
Read the original article
Hit count: 1173
Hi,
I have a particular situation:
a service started by a broadcast receiver starts an activity. I want to make it possible for this activity to communicate back to the service. I have chosen to use AIDL to make it possible. Everything seems works good except for bindService()
method called in onCreate()
of the activity. bindService(), in fact, throws a null pointer exception because onServiceConnected()
is never called while onBind()
method of the service is. Anyway bindService()
returns true.
The service is obviously active because it starts the activity.
I know that calling an activity from a service could sound strange, but unfortunately this is the only way to have speech recognition in a service.
Thanks in advance
© Stack Overflow or respective owner