TTS when receive ringtone
<p>When I receive a call on my android phone I want it to play a Text-To-Speech string instead of the default ringtone.</p>

<p>Here is the code that I tried however it doesn't work for me.</p>

<p>thanks</p>

<pre><code>private PhoneStateListener mPhoneListener = new PhoneStateListener() {
    public void onCallStateChanged(int state, String incomingNumber) {
        try {
            switch (state) {
            case TelephonyManager.CALL_STATE_RINGING:

                //----------------------------silence call-----------------------------
                AudioManager audiomanage = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
                audiomanage.setRingerMode(AudioManager.RINGER_MODE_SILENT);
                String name="Hello world";
                Intent checkIntent = new Intent();
                checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
                startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);
</code></pre>
