Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sample implementation for InfiniteWakefulIntentService
import android.content.Intent;
import com.announcify.uberall.droid.util.TextToSpeechHelper;
public class TextToSpeechService extends InfiniteWakelockIntentService {
private TextToSpeechHelper helper;
public TextToSpeechService() {
super("Announcify - Text-To-Speech");
public void onCreate() {
helper = new TextToSpeechHelper(this);
protected void onHandleIntent(Intent intent) {
protected boolean isFinished() {
return helper != null && helper.isReady() && helper.isFinished() && !helper.isSpeaking();
public void onDestroy() {

This comment has been minimized.

Copy link
Owner Author

@TomTasche TomTasche commented Apr 24, 2012

This isn't very helpful since you don't know what TextToSpeechHelper is and does, but I think it gives you an idea of how isFinished() should be implemented: don't return true until you have finished all work, e.g. waiting for callbacks and the like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment