I have a Service
class and an main Acitivity
class which is supposed to receive broadcasts from the Service class with method sendBroadcast.
From your stack trace, it appears you are somehow directly referencing your BTService
service. Since you cut your onCreate()
short I can't be certain how you are doing it, but I will take a guess.
Did you instantiate this service directly inside of your activity (use new BTService()
)? If so, then the reason you are getting this error is because your Service has no context bound to it. You must let Android create your service for you by calling startService()
or bindService()
.