I ask for help, so my life, and more importantly, my userβs life will not be destroyed by me, not knowing how to use the services and flows correctly.
I do not ask for a long explanation, but more confirmation. This is normal if I am wrong. I am here to study.
If I understand correctly: 1. The service runs in the background (without an interface). 2. Theoretically, the service will work forever until it kills itself (I take a big guess here) 3. the service will continue to work, even if the main activity is not visible (how about even destroyed?)
So, here is my encoding question.
I have my service setup and stream. Everything works fine, but only works once. I need him to go in cycles and keep checking. Once this is done by run (), how can I tell it to run () again?
public class NotifyService extends Service{ private long mDoTask; NoteThread notethread; @Override public IBinder onBind(Intent arg0) { return null; } @Override public void onCreate() { mDoTask = System.currentTimeMillis(); notethread = new NoteThread(); notethread.start(); } public class NoteThread extends Thread { NotificationManager nManager; Notification myNote; @Override public synchronized void start() { super.start();
source share