-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Android issue Voice issue when navigate goBack() #14
Comments
I'm not sure, I would have to look into it. Can you possibly record a |
Sorry for no .gif, Hi, when I use navigate to the function onSpeechResult to redirect to the next page
but as I go back using navigation.goBack() , the error I mention which happen. But I notice that if the result page is within the current page and move to the other pages and goback, it didn't have any issue. WHat Listner should I destroy? thanks, |
I would do something similar to the example: removeListeners() {
const error = Voice.destroy();
if (Voice.onSpeechStart != null) {
Voice.onSpeechStart.remove();
Voice.onSpeechStart = null;
}
if (Voice.onSpeechRecognized != null) {
Voice.onSpeechRecognized.remove();
Voice.onSpeechRecognized = null;
}
if (Voice.onSpeechEnd != null) {
Voice.onSpeechEnd.remove();
Voice.onSpeechEnd = null;
}
if (Voice.onSpeechError != null) {
Voice.onSpeechError.remove();
Voice.onSpeechError = null;
}
if (Voice.onSpeechResults != null) {
Voice.onSpeechResults.remove();
Voice.onSpeechResults = null;
}
if (Voice.onSpeechPartialResults != null) {
Voice.onSpeechPartialResults.remove();
Voice.onSpeechPartialResults = null;
}
if (Voice.onSpeechVolumeChanged != null) {
Voice.onSpeechVolumeChanged.remove();
Voice.onSpeechVolumeChanged = null;
}
} And before you navigate from the page or when the component is going to unmount: onSpeechResults(e) {
const { navigate } = this.props.navigation;
this.removeListeners();
navigate('Result', {channelp:0, searchit: true, skeyword: keyvt});
} |
got this error thanks, |
Ah, I see, I assumed wrong. Try doing this: removeListeners() {
Voice.destroy();
} The listeners are removed in the |
Now, its working. Thanks |
Just a heads up, you may want to update VoiceTest to reflect this change. Great stuff, BTW. |
Above was the issue I got when I try to navigate::goBack and play the mic button again. I'm not sure why the states we define on contruct is having an issue it already bind functions, is there missing function on this list? (I copied it on the example you provided)
Could you please guide me if you have come across this issue?
Thanks,
The text was updated successfully, but these errors were encountered: