title: How to open android activity from react native
body: <p>I want to open android native module from react native in the blank space shown in the figure  </p>
  
  <p><img src="https://i.stack.imgur.com/8QRCm.png" alt="image"></p>
  
  <p>But it is opening a new activity instead of showing on the same activity.</p>
  
  <p><strong>Here is my react native code</strong></p>
  
  <pre><code>MyNativeModule.nativeModule(data);
  </code></pre>
  
  <p><strong>Below is my MyNativeModule.java</strong></p>
  
  <pre><code>public class MyNativeModule extends ReactContextBaseJavaModule {
      public MyNativeModule(ReactApplicationContext reactContext) {
          super(reactContext);
      }
  
      @ReactMethod
      public void nativeModule(String token){
          Intent intent = new Intent(getReactApplicationContext(),MainActivity.class);
          intent.putExtra("data", data.toString());
          intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
          getReactApplicationContext().startActivity(intent);
      }
  
      @Override
      public String getName() {
          return "MyNativeModule";
      }
  }
  </code></pre>