说出ImageButton Click

时间:2013-05-05 19:15:08

标签: android android-imageview onclicklistener android-dialog

我确实实现了一个将Imageview作为项目的gridview,并点击了这些项目中的任意一个,弹出一个自定义对话框,提供图像的简要描述here

在对话框中,只有一个按钮可以在单击时关闭对话框。但是,我想知道如果我在对话框中添加第二个按钮并在点击第二个按钮时说出图像名称,代码和登录将如何。

提前致谢! : - )

1 个答案:

答案 0 :(得分:0)

你应该这样做

在列表视图的适配器中设置imageview的内容说明以及点击第二个按钮

使用imageview.getContentDescription ----这会返回一个charsequence,所以使用android TextToSpeech引擎使用其中的speak方法说出来...

像这样

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

现在使用说话方法..

tts.speak
相关问题