I have this piece of code
import { Linking } from 'react-native'
const action = "android.intent.action.WEB_SEARCH";
const extras = [
{ key: "query", value:"kittens" }
];
Linking.sendIntent(action, extras);
However, I get Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? So the fix seems to simply add this flag. How?
In android documentation I found that this flag has constant value 268435456, but I am unsure how to add that to intent.
I tried to set it in extras, but none of these work
{ key: "268435456", value: "" }
{ key: "268435456", value: "true" }
{ key: "268435456", value: "1" }
{ key: "flag", value: "268435456" }
{ key: "flags", value: "268435456" }