Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Is it possible to reposition the voice recognition popup window?

I'm just finishing up my voice recognition app and it works well. The user is given a question and answers via voice.

One nagging thing is that the voice recognition window pops up quite near the top of the phone screen and it would be nice if it was a bit lower so that it didn't obscure the text for the question.

Is it possible to do this programmatically?

===

Additional info:

Thanks, DroidBee. I am using the following code to call the voice recognition engine:

private void startVoiceRecognitionActivity()
{
  Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
  intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
        RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
  intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Voice recognition Demo...");
  startActivityForResult(intent, REQUEST_CODE);
}

I got this part of the code from a tutorial rather than producing it myself. I don't see anywhere that specifies a window or popup.

This is in the main activity and I also used: import android.speech.RecognizerIntent;

like image 988
user1758289 Avatar asked Oct 19 '12 05:10

user1758289


1 Answers

By seeing the question, what I understand is that you are having problem with the positioning of the window used for doing an action. But you haven't specified which one you are using. ( a Dialog, Popup Window etc.)

If you are using a popup window, you have to set the anchor according to the position where you have to set the window.

It might be easy if you can explain the type of window used. :)

Happy Coding..!!

like image 95
Aswathy P Krishnan Avatar answered Sep 18 '22 01:09

Aswathy P Krishnan