title: Pass activity result into a react native module
body: <p>I am trying to do some speech to text recognition using react native. I wrote a react module to start a recognizer intent </p>
  
  <pre><code>public class SpeechToTextModule extends ReactContextBaseJavaModule {
  
  ...
  
    @ReactMethod
    public void startListening(Callback errorCallback, Callback successCallback) {
  
      Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
      intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
              RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
  
      if(getCurrentActivity() != null){
          getReactApplicationContext().startActivityForResult(intent, SPEECH_REQUEST_CODE, null);
      } else {
          errorCallback.invoke(new NullPointerException("Activity is null"));
      }
  }
  
    public void onActivityResult(int requestCode, int resultCode, Intent data){
      // control must come here
    }
  </code></pre>
  
  <p>The mainactivity looks like this : </p>
  
  <pre><code>public class MainActivity extends ReactActivity {
  
    ...
  
    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
      // how do i invoke the module function?
    }
  }
  </code></pre>
  
  <p>MainActivity receives the result from the voice intent, but I cant figure out how I can pass it over to the module.</p>