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

Android: Fixes #6732: Don't reload the application on screen rotation #6737

Merged

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

Testing plan

(On Android)

  1. Deploy a copy of the app from AndroidStudio
  2. Open a note
  3. Enter edit mode
  4. Rotate the screen

On origin/dev: On my tablet, after step 4, the app exits edit mode and scrolls to the top of the note (the app is partially reloaded). With this PR, the app stays in edit mode.

@laurent22
Copy link
Owner

Do you understand the reason why these parameters fix the issue? If so could you add a comment above the "android:configChanges" line please?

@personalizedrefrigerator
Copy link
Collaborator Author

personalizedrefrigerator commented Aug 12, 2022

Related:

I'm not entirely sure why these changes fixed the issue. I just tested laurent22/dev on an Android emulator and am not experiencing the issue. I think my (Samsung) tablet might be configured to treat orientation changes as window resizes.

According to the above links, screenLayout and smallestScreenSize are for multi-window/split screen layout changes. My tablet was operating in single-window mode.

@roman-r-m
Copy link
Collaborator

I'm not entirely sure why these changes fixed the issue.

From https://developer.android.com/guide/topics/manifest/activity-element

android:configChanges
Lists configuration changes that the activity will handle itself. When a configuration change occurs at runtime, the activity is shut down and restarted by default, but declaring a configuration with this attribute will prevent the activity from being restarted. Instead, the activity remains running and its onConfigurationChanged method is called.

@roman-r-m
Copy link
Collaborator

I don't see how smallestScreenSize is relevant but having it won't hurt I guess

@tessus tessus added the android label Aug 14, 2022
@laurent22 laurent22 merged commit 09ec77f into laurent22:dev Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android: Note screen/settings screen resets on screen rotation change
4 participants