Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App is restarted on split-screen #799

Closed
3 tasks done
ttencate opened this issue Aug 5, 2019 · 3 comments · Fixed by #800
Closed
3 tasks done

App is restarted on split-screen #799

ttencate opened this issue Aug 5, 2019 · 3 comments · Fixed by #800

Comments

@ttencate
Copy link

ttencate commented Aug 5, 2019

Bug Report

Problem

What is expected to happen?

App keeps running in split screen, just resized.

What does actually happen?

Activity is restarted.

Information

Command or Code

Press and hold the "square" button on any modern Android device to trigger split screen mode. Notice how the Cordova app is restarted.

This is fixed if I add the following to my config.xml:

<edit-config file="AndroidManifest.xml" target="/manifest/application/activity[@android:name='MainActivity']" mode="merge">
  <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" />
</edit-config>

This is the default list of configChanges with |smallestScreenSize|screenLayout|uiMode appended. See docs: https://developer.android.com/guide/topics/manifest/activity-element#config

I propose that at least smallestScreenSize|screenLayout are added to the default AndroidManifest.xml. uiMode is not necessary to fix this issue, but should maybe be in the default list as well.

Environment, Platform, Device

Android 7.1.2

Version information

Cordova 9.0.0
Cordova Android 8.0.0

Checklist

  • I searched for existing GitHub issues (Restart on split-screen #744 is a duplicate, but folks explicitly requested a new issue)
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@breautek
Copy link
Contributor

breautek commented Aug 5, 2019

Thank you for filling out completely, and it's awesome you even provided a possible solution.

We will welcome a PR, or if you prefer I can test this out and do a PR.

@ttencate
Copy link
Author

ttencate commented Aug 5, 2019

The code change is trivial but indeed it's the testing where I'd prefer someone more experienced to take over.

@breautek
Copy link
Contributor

breautek commented Aug 5, 2019

I'd also like to add the ability to disable the resize activity altogether as discussed in #744 just to have a more complete resize activity support feature. I'll start one right now, but not sure if I'll have time to publish a PR today.

Edit: Opted not to include the ability to disable resizing altogether as it is quite more involved including adding android specific code to cordova-common, something that we are currently trying to move away from doing.

breautek added a commit to breautek/cordova-android that referenced this issue Aug 6, 2019
breautek added a commit to breautek/cordova-android that referenced this issue Aug 6, 2019
breautek added a commit to breautek/cordova-android that referenced this issue Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants