samedi 19 décembre 2020

What type of data is captured while speech recognition?

@Override
        public void onResults(Bundle bundle) {
            ArrayList<String> matches = bundle
                    .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);

            if (matches != null) {
                Toast.makeText(getApplicationContext(), matches.get(0), Toast.LENGTH_LONG).show();
                if (matches.get(0).toLowerCase() == "a") {
                    cong.start();
                    imC.setVisibility(View.VISIBLE);
                }
            }
        }

Have got a mistake in nested if statement block?enter image description here

output: must be:enter image description here

Aucun commentaire:

Enregistrer un commentaire