If you want your IBeaconConsumer
implementation to not be an instance of Activity
or a Service
, then you simply need to chain the bindService
and unbindService
methods to a valid ApplicationContext
instance, and return that valid instance from the getApplicationContext
method. This is not needed when you are implementing this interface with an Activity
, because an Activity
implements these three methods for you.
You can see an example of this in a related question here.