Skip to content

Ability to open another app in a new task instead of on top of the exisiting task (using _system) #735

@mshaikh7

Description

@mshaikh7

Feature Request

Motivation Behind Feature

Invoking locally installed app in any launch mode based on the app thats getting invoked.

Feature Description

There should be a plugin level config to open another app from current app in different launch mode. We can currently do that by specifying launch mode at app level in config.xml but that applies to the entire app and not just for inappbrowser plugin.

Alternatives or Workarounds

Currently when from App 1 if I open App 2 which is locally installed on the system using below method it opens it on top of the current app and app1 becomes hidden n inaccessible:
this.inAppBrowser.create(url, '_system')

I have done a temp work around which might not be correct in android source code for the plugin as below to open app2 in new task always (Keeping my app1 launch mode to singleTop itself)

`private void openExternalExcludeCurrentApp(Intent intent) {
// If the current app package isn't a target for this URL, then use
        // the normal launch behavior
        if (hasCurrentPackage == false || targetIntents.size() == 0) {
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // added this line
            this.cordova.getActivity().startActivity(intent);
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions