Skip to content

Instantly share code, notes, and snippets.

@vmanyushin
Created September 15, 2017 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vmanyushin/2f646123d44858f464aed07a94e35c5b to your computer and use it in GitHub Desktop.
Save vmanyushin/2f646123d44858f464aed07a94e35c5b to your computer and use it in GitHub Desktop.
service
package com.example.swop.avcrmmobile;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
public class StubService extends Service {
public StubService() {
}
@Override
public IBinder onBind(Intent intent) {
throw new UnsupportedOperationException("Not yet implemented");
}
public int onStartCommand(Intent intent, int flags, int startId) {
Runnable run = new Runnable() {
public void run() {
while (true) {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
return;
}
}
}
};
Thread thread = new Thread(run);
thread.start();
return super.onStartCommand(intent, flags, startId);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment