In my app I have a child class that extends a support library class called SearchFragment
in the leanback support library. I need to extend this class but unfortunately the onPause()
of the parent (SearchFragment
) class has a method I cannot use.
Every time I leave the activity the parent class runs the onPause()
which calls the method I don't want.
Is there a way I can extend the SearchFragment
class but not allow it to run its own onPause()
?
Here is the onPause()
method in the parent class that I cannot alter.
android.support.v17.leanback.app.SearchFragment
@Override
public void onPause() {
releaseRecognizer(); //Need to stop this from calling
super.onPause();
}
private void releaseRecognizer() {
if (null != mSpeechRecognizer) {
mSearchBar.setSpeechRecognizer(null);
mSpeechRecognizer.destroy();
mSpeechRecognizer = null;
}
}
Also, the reason I am doing this is because this is an Android TV > Fire TV port. Fire TV does not have a speechRecognizer.