Intent helloservice = new Intent(this, HelloService.class);
startService(helloservice);
...
stopService(helloservice);
Why won't this work? It just keeps running. Am I missing some Binds or something?
By the way, this is my service:
public class HelloService extends Service {
private Timer timer = new Timer();
private long INTERVAL = 1000;
public void onCreate() {
super.onCreate();
startservice();
}
private void startservice() {
timer.scheduleAtFixedRate( new TimerTask() {
public void run() {
Log.d("service", "This proves that my service works.");
}
}, 0, INTERVAL);
; }
@Override
public IBinder onBind(Intent arg0) {
return null;
}
}