GoogleChrome / GoogleChrome/android-browser-helper
Cannot open multiple TWA application instances
- Dominant language
- Java
- Stars
- 832
- Forks
- 370
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
**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):**
- Device: Samsung Galaxy Tab S9 Ultra
- OS: Android 13
- Browsers Installed: Chrome
- Browser Versions: 124.0.6367.82
- android-browser-helper library version: 2.5.0
**Additional context**
It seems like the behavior is defined [here](https://github.com/GoogleChrome/android-browser-helper/blob/main/androidbrowserhelper/src/main/java/com/google/androidbrowserhelper/trusted/LauncherActivity.java#L122), 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.
Contributor guide
Assessment
This issue has not been assessed yet.