0

I did implement a gridview having Imageviews as its items and onClick on any of these items, a custom dialog box pops up to give a brief description of the image as seen here.

In the dialog box, there's just one button which closes the dialog box on click. However, I was wondering how the code and login would be if I were to add a second button to the dialog box and speak out the image name on click on that second button.

Thanks in advance! :-)

Community
  • 1
  • 1
hermie_brown
  • 319
  • 9
  • 24

1 Answers1

0

you should do this

in your adapter of your list view set the content description of your imageview and on the click of your second button

use imageview.getContentDescription ----this returns you a charsequence so speak it using android TextToSpeech engine using the speak method in it...

like this

TextToSpeech tts=new TextToSpeech(this,this) //first for context and other for the onInitListener

now use the speak method..

tts.speak
cafebabe1991
  • 4,928
  • 2
  • 34
  • 42