0

I have a fragment on which bottom bar fragment is attached. On the bottom bar I have some inputs which allow me to fill with voice recognition results. I call startActivityForResult by

getParentFragment().startActivityForResult(descriptionEditText.getRecognizerIntent(), VOICE_RECOGNITION_REQUEST_CODE);

My onActivityResult (calling from parent fragment):

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == VOICE_RECOGNITION_REQUEST_CODE) {

        if (resultCode == RESULT_OK && null != data) {
            ArrayList<String> result = data
                    .getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
            descriptionEditText.setText(result.get(0));
        }
    }
}

Everything seems to work good, but after the voice recognition intent is getting starting, the bottom bar hides for the moment, voice recognizer activity is active. I want to avoid it.

To be more clear, what I would like to achieve, there are some screen shots.

before clicking on voice input

image1

after clicking on voice input

image2

  • Possible duplicate of [How can I use speech recognition without the annoying dialog in android phones](https://stackoverflow.com/questions/6316937/how-can-i-use-speech-recognition-without-the-annoying-dialog-in-android-phones) – Nikolay Shmyrev Dec 10 '17 at 22:59
  • @NikolayShmyrev, I do not want to get rid of a dialog. Just prevent killing nested fragments. –  Dec 11 '17 at 08:34

0 Answers0