mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 09:45:04 +00:00
Fix minor code nit from D2977441
Reviewed By: andreicoman11 Differential Revision: D2982182 fb-gh-sync-id: dba3c6ea0dfbd375e3c27d3ad2ba3481d05e06e8 shipit-source-id: dba3c6ea0dfbd375e3c27d3ad2ba3481d05e06e8
This commit is contained in:
parent
9baef48498
commit
9edfd945d1
@ -86,16 +86,15 @@ public class IntentModule extends ReactContextBaseJavaModule {
|
||||
getReactApplicationContext().getPackageManager());
|
||||
String otherPackageName = (componentName != null ? componentName.getPackageName() : "");
|
||||
|
||||
// Always add the FLAG_ACTIVITY_NEW_TASK if we are launching to a different package
|
||||
if (!selfPackageName.equals(otherPackageName)) {
|
||||
// If there is no currentActivity or we are launching to a different package we need to set
|
||||
// the FLAG_ACTIVITY_NEW_TASK flag
|
||||
if (currentActivity == null || !selfPackageName.equals(otherPackageName)) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
}
|
||||
|
||||
if (currentActivity != null) {
|
||||
currentActivity.startActivity(intent);
|
||||
} else {
|
||||
// If no currentActivity, we want to always start a new task regardless of logic above
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
getReactApplicationContext().startActivity(intent);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user