TextToSpeech with API 21
问题 Can someone help me using TTS with API 21. All examples available are deprecated with version 21 Here's my code giving error on last line: Calendar cal = Calendar.getInstance(); cal.getTime(); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); String text = sdf.toString(); btn.setText("Ouvir as Horas"); TextToSpeech tts = new TextToSpeech(NightClock.this,(TextToSpeech.OnInitListener) NightClock.this); tts.setLanguage(Locale.US); tts.speak(text, TextToSpeech.QUEUE_FLUSH, null); In Android