I\'m trying to restart service from itself in a few time. My code looks like this (inside the onStartCommand(...))
Looper.prepare();
Handler han
I would declare the Handler variable at the Service level, not locally in the onStartCommand, like:
public class NLService extends NotificationListenerService {
Handler handler = new Handler();
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
handler.postDelayed(new Runnable() {....} , 60000);
}
And the service has its own loop, so you do not need Looper.prepare();