android - how to start the intent service using alarm manger -


I want to start my intention service with alarm manager and my intent is being started by service service .. but Please help me please do this, this is my code service code

  create on public zeros (intent intention = new intention (this, DownloadService.class); StartService (intent); Calendar cal = calendar.justinstance (); Cal.add (calendar. SECOND, 10); Pending Vertical Paint = Pending .entet (this, 0, intent, 0); Get AlarmManager Alarm = (AlarmManager) System System (Context .ALARM_SERVICE); Alarm.Setcoding (Alarm Manager. RTC_wecup, Cal. Gatetime Inimlis (), 10 * 1000, Pintant); Alarm.SetInxpect Reparating (alarm manager. RTC_quackup, cal. Gatetime inimlis (), 10 * 1000, pinant); } Public int onStartCommand (intended intent, int-flags, int startId) {Toast T = Toast. GetApplicationContext, "Start command in the service", Toast. LNNHHLAG); t.show (); Intent = new intention (this, DownloadService.class); startService (intent); Calendar cal = calendar.justinstance (); Cal.add (calendar. SECOND, 10); Pending Vertical Paint = Pending .entet (this, 0, intent, 0); Get AlarmManager Alarm = (AlarmManager) System System (Context .ALARM_SERVICE); Alarm.Setcoding (Alarm Manager. RTC_wecup, Cal. Gatetime Inimlis (), 10 * 1000, Pintant); Alarm.SetInxpect Reparating (alarm manager. RTC_quackup, cal. Gatetime inimlis (), 10 * 1000, pinant); Return Super.Onstart Commands (Intent, Flags, Beginners); } Public IBinder onBind (intent arg0) {return tap; }   

Please help me solve this problem

Pending Pentent = Change your code with pending ITAT service (this, 0, intent, 0)

You need to use pending information. FLAG_UPDATE_CURRENT

; to

  pendinginstant = tentative.gates service (this, 0, serviceinent, pending.ent.flag_updictertyrtt);    

Comments

Popular posts from this blog

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -