-1
I am beginner in Android and I made a structure for Speech to text, I would like to know how to trigger a button inside the application using this function.
-1
I am beginner in Android and I made a structure for Speech to text, I would like to know how to trigger a button inside the application using this function.
0
Hello, can you capture the right text yet? if not yet this tutorial exemplifies everything: http://www.androidhive.info/2014/07/android-speech-to-text-tutorial/
if you implemented similarly within the onActivityResult method just compare the return of the voice with the action and call the Runnable that was linked to the button.
EDITION
public class MainActivity extends Activity {
private Button botaoAcao;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
botaoAcao.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
acaoDoBotao().run();
}
});
}
private Runnable acaoDoBotao() {
return new Runnable() {
@Override
public void run() {
//acao do botao
}
};
}
And inside the onActivityResult to call the boot just call the acaoDoBotao().run();
Browser other questions tagged java android
You are not signed in. Login or sign up in order to post.
I can capture the text yes and turn it into a string , what I get complicated is just how I call the button
– Rodolfo Allesson
got it... I will edit in the above answer an example.
– João