android - How to call jobFinished from IntentService -
i trigger inside jobservice intentservice encapsulate simple tasks. how should call jobfinished( param, false ) after intentservice has finished , tell jobservice done? should bind jobservice , call directly or exist better solution?
in many cases, have interface , pass along object implements it. dialogs example have onclicklistener.
just random example:
// callback interface interface mycallback { void callbackcall(); } // class takes callback class worker { mycallback callback; void onevent() { callback.callbackcall(); } } // option 1: class callback implements mycallback { void callbackcall() { // callback code goes here } } worker.callback = new callback(); // option 2: worker.callback = new mycallback() { void callbackcall() { // callback code goes here } };
Comments
Post a Comment