How to handle the visibility of an image(ImageView) in the event the RecognizerIntent finishes due to the user not speaking
if (RecognizerIntent.EXTRA_RESULTS == null){
image1.setVisibility(View.VISIBLE);///microphone icon
}
or
if (RecognizerIntent.ACTION_RECOGNIZE_SPEECH == null){
image1.setVisibility(View.INVISIBLE);///microphone
}
thnx
In the code above you are just testing if the constants are null, which they are not. You have to start the recognition somewhere in the code by
and receive the result in
A more customizable way is to use SpeechRecognizer directly. See for example this question.