Created
September 15, 2017 11:24
-
-
Save vmanyushin/2f646123d44858f464aed07a94e35c5b to your computer and use it in GitHub Desktop.
service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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