I have a Service in my android application which stop only when quitting the application.
public class MyService extends Service {
public MyService() {
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
try {
if(intent != null){
//......
}
} catch (Throwable e) {
}
return START_STICKY;
}
@Override
public void onDestroy() {
super.onDestroy();
}
@Override
public void onCreate() {
super.onCreate();
//......
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
}
This service calls its onCreate() method sometimes itself while running.When checking the state of service it is running but its functionalities does not work.I am stuck on this for many hours.What is the problem here?I tried onLowMemory() in this service.But not result.