Android Voice Recognition callback not working
<p>I'm trying to implement speech recognition in my app. It loads the speech recognition panel fine, recognises what you say, then once it's finished it's supposed to return to the app calling the onActivityResult method. Unfortunately it doesn't and just returns to the device home screen. Any ideas what I'm doing wrong?</p>

<pre><code>static final int VOICE_RECOGNITION_REQUEST_CODE = 1234;

/**
 * Handler from the listening thread
 */
public Handler mhandle = new Handler() {
    @Override
    public void handleMessage(Message msg) {
        switch (msg.what) {
            case MAXOVER_MSG :
                Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
                intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
                startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);
            break;
            default :
                super.handleMessage(msg);
            break;
        }
    }

};

/**
 * Handle the results from the recognition activity.
 */
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == VOICE_RECOGNITION_REQUEST_CODE &amp;&amp; resultCode == RESULT_OK) {
        Log.i("hmm","This never seems to get called..");
    }

    super.onActivityResult(requestCode, resultCode, data);
}
</code></pre>
