Android Tv Searchfragment Error Speechrecognizer
Actually I am new to Leanback and I am working in the search part and implement SearchFragment. I am facing this issue on error log message (when run on device, but working on andr
Solution 1:
It may not be relevant anymore, but I myself did something like:
overridefunonResume() {
super.onResume()
try {
if (!Utils.isATV(requireContext())) {
val mSpeechRecognizerField: Field = SearchSupportFragment::class.java.getDeclaredField("mSpeechRecognizer")
mSpeechRecognizerField.isAccessible = true
mSpeechRecognizerField.set(this, null)
}
} catch (e: Exception) {
Log.e("", "Method not found")
}
}
Conditions and checks can be done at your discretion. I have voice search on Google's AndroidTV (leanback), but on other devices it is turned off.
You can check for the presence of the service itself in the system.
Post a Comment for "Android Tv Searchfragment Error Speechrecognizer"