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 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 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: - code snippet: AlarmManager . I have one that does not update
anytime (updated manual) in which I cancel the
toStopServiceAlarm () to
alarmmanager .
Q:
never updated (updated manual) , where I already canceled any
AlarmManager triggers.
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 ()).
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
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
Post a Comment