3

Docs enter link description here say how to start and finish service. Is there any way to bind with existing one with android annotation?

Jacob
  • 14,949
  • 19
  • 51
  • 74

1 Answers1

2

When you bind to your Service, simply use the generated class:

Intent intent = new Intent(this, MyService_.class); // note the underscore
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);

Or you can use the generated Intent builder:

bindService(MyService_.intent(this).get(), mConnection, Context.BIND_AUTO_CREATE);
WonderCsabo
  • 11,947
  • 13
  • 63
  • 105