0

I need to know if a specific service is available (running or can be created) before calling Context.bindService.

Is there a way to check that ?

Vikash Pandey
  • 5,407
  • 6
  • 41
  • 42
ThomasV
  • 779
  • 1
  • 5
  • 20

1 Answers1

0

please see the comments

 ServiceConnection serviceConnection = new ServiceConnection() {
        @Override
        public void onServiceConnected(ComponentName name, IBinder service)    {
    // capture the service object , check for alive or not
         service.isBinderAlive(); 

        }

        @Override
        public void onServiceDisconnected(ComponentName name) {

        }
    };
Sush
  • 3,864
  • 2
  • 17
  • 35