fixed a crash occuring sometimes when stopping voice input
This commit is contained in:
parent
d468086950
commit
96045cacc7
1 changed files with 2 additions and 2 deletions
|
|
@ -65,7 +65,7 @@ public class VoiceInputOps {
|
||||||
|
|
||||||
|
|
||||||
public boolean isListening() {
|
public boolean isListening() {
|
||||||
return listener.isListening();
|
return listener.isListening() && speechRecognizer != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -100,7 +100,7 @@ public class VoiceInputOps {
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
this.language = null;
|
this.language = null;
|
||||||
if (isAvailable() && listener.isListening()) {
|
if (isAvailable() && isListening()) {
|
||||||
speechRecognizer.stopListening();
|
speechRecognizer.stopListening();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue