android - IntentService doesn't want to start -


i want start intentservice activity didn't running. have tried tested using toast or log still didn't give reaction.

is there have gone wrong ?

this activity:

 public class backgroundapplication extends activity  {  @override  protected void oncreate(bundle savedinstancestate) {       findviewbyid(r.id.cmdserviceia).setonclicklistener(new view.onclicklistener() {         @override         public void onclick(view v) {             intent msgintent = new intent(backgroundapplication.this, service2.class);             startservice(msgintent);         }     }); 

this intentservice :

public class service extends intentservice{ @override protected void onhandleintent(intent intent) {     mhandler.post(new displaytoast(this, "service start!")); } public class displaytoast implements runnable {     private final context mcontext;     string mtext;      public displaytoast(context mcontext, string text){         this.mcontext = mcontext;         mtext = text;     }      public void run(){         toast.maketext(mcontext, mtext, toast.length_short).show();     } } 

any ideas ?


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -