android - Service started again after killed by task manager -


The

There are several options to sync data between I have Android app server I I synchronize with the user options I am using AlarmManager . I have one that does not update anytime (updated manual) in which I cancel the toStopServiceAlarm () to alarmmanager .

Q:

It is working fine till my application will not be killed by any task manager as soon as it has been killed by the Task Manager Apps Service , Again the never updated (updated manual) , where I already canceled any AlarmManager triggers.

Can someone help me keep up my application, even if it was killed by the task manager? Sync is said only according to user preferences.

The code snippet: -

  public class ServiceAlarm WakefulBroadcastReceiver spreads (available at public spaces (reference model, meaning intended) {Intent service = new Intent ( reference, UploadData.class); // Aploddeta my service start WakefulService (reference service);} public void StartServiceAlarm (string Times) {context = SmartConsultant.getApplication (). getApplicationContext (); Alarmmdiar = (Alarmmnajr) context.getSystemService (Context .ALARM_SERVICE); intent = new intent (SmartConsultant.getApplication (). GetApplicationContext (), UploadData.class); alarmIntent = P EndingIntentkgetBroadcast (context, 0, intent, 0); Calendar = Kailender.ast Instens (); CalendarksetTimeInMillis (SystemkcurrentTimeMillis ()); Kailenderkset (calendar. HOUR_OF_DAY, 21); Kailenderkset (calendar . minutes, 00); switch (integer. Parasent (time)) {case 0: // Midnight Alarmmjiar Ksetaineksek Reengineering (alarm Manajr. Artisi_vekyup, Kailenderkgettaim Inmilis (), Alarmmenger. Intrvlday, Alarmmntent); break; ... cases for different intervals of sync}} Public Nil STPS Service Alarm (String Times) {If (alarmmg = zero) {alarmMgr.cancel (alarmIntent); According to the Commonsware, I just need to override  onStartCommand ()).    

with START_NOT_STICKY which my service is strict with Android Will tight up and once it is killed by the TaskManager will not start. What is the behavior that is going on from service

code snippet:

  extends the public category upload data service {... @Override public int onStartCommand (intent intent, int flags, int startId) generated {// TODO Auto- method stub Suprkonstart Command (intent, flags, first); Return START_NOT_STICKY; }}    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -