Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 30343

FLAG_ACTIVITY_NEW_TASK error integrating android native library in react native

$
0
0

I'm trying to integrate a native payment library in a react native application.

The library requires an view setup like this to process the pay result.

The library raises next error

Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

I don't know if my configuration is wrong, the native library demo application works fine. :( The pay response intent tries load the activity but apparently it can't find it.

Update
The library function that fails is:

String appId = context.getPackageName() + "." + callbackSchema;
Intent intent = new Intent(appId);
intent.putExtra(ConstantUtil.RETURNED_JSON_KEY,json);
context.startActivity(intent); // <- this call raises the error

Update Finally I made it work. I was passing context like that:

getReactApplicationContext()

I solved it passing context like that:

getCurrentActivity()

In debug, I got this values:

enter image description here

but the error still raising :(

Any idea?


Viewing all articles
Browse latest Browse all 30343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>