How to bind to running android service? -
I hope this is a problem with anything other than code and I'm hoping that there is no help from that Can track the problem.
I have another code that starts the service with startService () and I can confirm that the service has started because the debugger hits the oncond () function of the decoder service.
However, the bindService is not connected to the running service. Is this an asynchronous call and I have to wait to finish something?
The result of the public class increases the activity (Secure Zero Restart ()) {// The Two-Auto Auto-Generated Method Stub Super. Rebirth (); Intent decoderient = new intent (this, decoderseva class); _isBound = Binseva (Decoder Intent, Mconction, Context. BIFATOOCRert); _textView.start (_mBoundService); } Private Boolean _isBound = false; Private decoder service _mBoundService; Private service connection mConnection = New service connection () {Service connected on public wired (Component name class name, IBinder service) {_mBoundService = ((DecoderWirebinder) service) .getService (); } Service Disconnect on Public Zero (ComponentName className) _mBoundService = null; }}; } Provides public class DecoderService service {secure void onHandleIntent (Intent intention) {// TODO Auto generated method stub _numCompleted = 5; _numTotal = 100; } Protected int _numCompleted = 0; Protected int _numTotal = 0; Crate on Public Zero () {Onhand Intent (empty); } @ Override Public Ibinter on Bint (Intent Intent) {Return MB Inder; } // This is the object that receives interaction from customers // See the remote service for a more complete example. Private Final IBirder Mbender = New Local Binder (); Public Class LocalBuilder Brandon (Decoder System _ RF = Null; Public Local Builder) {_ref = VikodorService;} DecoderService GetService () {Return DecoderService.this;}}}
Is this an inelegant call and I have to wait for it to complete something?
Binding is on
on
called your service connection
item until ready.
Comments
Post a Comment