Code example for TextToSpeech

     * {@inheritDoc} 
    public void onServiceConnected() { 
        // Initializes the Text-To-Speech engine as soon as the service is connected. 
        mTts = new TextToSpeech(getApplicationContext(), this);
     * Processes an AccessibilityEvent, by traversing the View's tree and 
     * putting together a message to speak to the user. 
    public void onAccessibilityEvent(AccessibilityEvent event) {
        if (!mTextToSpeechInitialized) {
            Log.e(LOG_TAG, "Text-To-Speech engine not ready.  Bailing out.");
        // This AccessibilityNodeInfo represents the view that fired the 
Contextual code suggestions in your IDE  Get Codota for Java