I tried the other assignment for string, list, don't have a way to pass the value to the queue, solving,
Public void btnvoice (Context application, final EditText result) {
Dialog. SetListener (new RecognizerDialogListener () {
@ Override
Public void onResult (RecognizerResult RecognizerResult, Boolean b) {
String sentence=parseIatResult (recognizerResult getResultString ());
Text=sentence;//1
Result. Append (sentence);//2
}
@ Override
Public void one rror (SpeechError SpeechError) {
}
});
Dialog. The show ();
Toast. MakeText (application, "please began to speak," Toast. LENGTH_SHORT), show ();
Result. Append (text);
}
CodePudding user response:
Message may not be able to reply in time, can add my QQ: 2691049696CodePudding user response:
You can take a look at this https://blog.csdn.net/qq_38436214/article/details/106900471CodePudding user response:
Use interface + listener callback wowCodePudding user response: