GoogleChrome / android-browser-helper

The Android Browser Helper library helps developers use Custom Tabs and Trusted Web Activities on top of the AndroidX browser support library.
Apache License 2.0
688 stars 286 forks source link

Cannot open multiple TWA application instances #469

Open lowkahonn opened 4 months ago

lowkahonn commented 4 months ago

Describe the bug When trying to open more than one application instances, a prompt with " is already running" is shown, and the new instance is killed and bring the existing instance into focus instead.

To Reproduce Steps to reproduce the behavior:

  1. Open a TWA application in one split screen
  2. Open the same TWA application in another split screen
  3. The second instance does not open, and we see the toast " is already running"

Expected behavior TWA applications can be opened in split screen as expected

Did this ever used to work Does not seem so

Screenshots None

Code Snippets Just by using the LauncherActivity class.

Smartphone (please complete the following information):

Additional context It seems like the behavior is defined here, where it'd bring an existing instance to focus and does not allow more than one instances to be opened. Not sure if there are any reasons doing so, but it'd be great if we can support opening multiple application instances in split screens to unlock more use cases.

andreban commented 4 months ago

CC @SayedElabady