Android activity accessing service's static reference before the service is ready
问题 I am trying to fire a Text to speech service from an activity and the activity based on certain events would cause the appropriate string to be sent to the service which speaks out. Here is my TTSService: public class TTSService extends Service implements TextToSpeech.OnInitListener{ private String str; private TextToSpeech mTts; private static final String TAG="TTSService"; public static TTSService sInstance; @Override public IBinder onBind(Intent arg0) { return null; } @Override public void