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     }  };

just image better understandingenter image description here


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -