0

When an app first launches it says the app name when in talk back mode. Afterwards i'd like to to say "please wait" automatically without user pressing any button. How can this be achieved ?

here is my activity code:

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

}



}
j2emanue
  • 60,549
  • 65
  • 286
  • 456
  • Simply make it say the app name + ". Please wait". The dot acting as a small pause. – Phantômaxx Oct 23 '15 at 14:36
  • can you show code how this would be done ? its automatically saying the app name on start. How do i add to that ? are you saying i should change the app name string at run time ? – j2emanue Oct 23 '15 at 15:39
  • You don't have to change your app's name. Somewhere in your code, you're calling the `speak()` method of the TTS engine, and you pass it the string to say. Just append the other part of text to it. – Phantômaxx Oct 23 '15 at 15:48
  • oh i see what you mean, i can use the text to speech engine. and i can know if accessibility is active using: http://stackoverflow.com/questions/5116867/how-to-know-if-android-talkback-is-active but i'd have to time it to run after the accessiblity speaks the app name already . – j2emanue Oct 23 '15 at 16:10
  • Now I see what you mean. You were using an Android automated feature... You have no control over it. But (using the TTS Engine) you can simply put your `speak()` call into the `onActivityCreated()` method of the main Activity of your project, in order to make it say whatever you want after the Activity was shown. – Phantômaxx Oct 24 '15 at 08:56
  • Yes your right. Just don't know at what life cycle event the android automation begins so i can time my text to speech – j2emanue Oct 24 '15 at 14:03
  • Try calling `speak()` in the `onActivityCreated()` or in `onCreate()`. – Phantômaxx Oct 24 '15 at 15:18
  • 1
    hmm i just added a timer in onPostCreate delayed a few seconds then it speaks. thanks for you help. you can post a answer if you feel. – j2emanue Oct 25 '15 at 14:16

0 Answers0