Murtaza
Murtaza

Reputation: 41

Android Service Stops after a while

my code runs at Android 5.1 (API level 22), in my application ondestroy activiit i will start my service for background works. for a while everything goes normal and service is in running state. bu sudenly it stop. whos can is prevent is from stoppng

context.startService(new Intent(context, RunningService.class));

` @Nullable @Override public IBinder onBind(Intent intent) { return null; }

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    return START_STICKY;
}`

Upvotes: 1

Views: 48

Answers (0)

Related Questions