我刚接触Android / Java,需要一些指导。
有人可以在下面解释为什么无法解析getApplicationContext()的原因吗?
private void readText(final String s) {
textToSpeech = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
if (status == TextToSpeech.SUCCESS){
textToSpeech.speak(s, TextToSpeech.QUEUE_FLUSH, null);
}
}
});
}