Code example for Context

Methods: startActivity

0
                initTTS(); 
            } else { 
                // missing data, install it 
                Intent installIntent = new Intent();
                installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
                context.startActivity(installIntent);
            } 
 
            return true; 
        } 
 
        return false; 
    } 
 
    private void initTTS() { 
        mTts = new TextToSpeech(context, (OnInitListener)this);
    } 
 
    public void queueSpeak(String textToSpeak) {
        if (mTts != null && isTTSInitialized) {
            mTts.speak(textToSpeak, TextToSpeech.QUEUE_ADD, ttsParams);