nextcloud / nextcloud/notes-android
crash while rotating screen
Open
Nobody has claimed this yet.
0. Needs triage
bug
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 168
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 31
Description
This issue respects the following points:
- I have read the FAQ
- I have searched for existing issues
- The issue affects the Notes Android app, neither the Notes server app nor the Nextcloud Android app.
Describe the bug
- open notes app
- open a note
- rotate phone/tab from portrait to landscape and backwards
- see crash report
Expected behavior
no crash should happen
Notes Android version
4.3.1
Notes server version
current
Nextcloud Android version
current
Nextcloud version
current
Device
huawei tab & xiaomi phone
Android Version
9 & 12
App Store
- Google Play Store
- F-Droid
- Huawei App Gallery
Stacktrace
App Version: 4.3.1
App Version Code: 40030190
App Flavor: fdroid
Files App Version Code: 30310190 (PROD)
---
OS Version: 4.9.148(9.1.0.335C432)
OS API Level: 28
Device: HWSHT
Manufacturer: HUAWEI
Model (and Product): SHT-W09 (SHT-W09)
---
java.lang.IllegalStateException: Fragment NotePreviewFragment{930fed0} (a5a3874e-cade-408c-bab5-71f23dba5ce9) not attached to a context.
at androidx.fragment.app.Fragment.requireContext(Fragment.java:973)
at it.niedermann.owncloud.notes.edit.SearchableBaseNoteFragment.isDirectEditEnabled(SearchableBaseNoteFragment.java:127)
at it.niedermann.owncloud.notes.edit.SearchableBaseNoteFragment.onScroll(SearchableBaseNoteFragment.java:76)
at it.niedermann.owncloud.notes.edit.BaseNoteFragment.lambda$onNoteLoaded$7(BaseNoteFragment.java:288)
at it.niedermann.owncloud.notes.edit.BaseNoteFragment.$r8$lambda$EJlcUQvLIqXm-xkAsDraxLkeSGY(Unknown Source:0)
at it.niedermann.owncloud.notes.edit.BaseNoteFragment$$ExternalSyntheticLambda4.onScrollChange(D8$$SyntheticClass:0)
at android.view.View.onScrollChanged(View.java:14448)
at android.view.View.scrollTo(View.java:16283)
at android.widget.ScrollView.scrollTo(ScrollView.java:1727)
at android.view.View.setScrollY(View.java:14549)
at it.niedermann.owncloud.notes.edit.NotePreviewFragment.lambda$scrollToY$0(NotePreviewFragment.java:78)
at it.niedermann.owncloud.notes.edit.NotePreviewFragment.$r8$lambda$LkKyPR_ZO0gVumuqQmYwvMRphNg(Unknown Source:0)
at it.niedermann.owncloud.notes.edit.NotePreviewFragment$$ExternalSyntheticLambda4.run(D8$$SyntheticClass:0)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SearchableBaseNoteFragment.java at isDirectEditEnabled and onScroll, then trace the callback from BaseNoteFragment.java:288 and NotePreviewFragment.java:78. Reproduce the portrait-to-landscape rotation while a note is open and check the detached-fragment stack trace. Done means rotating between orientations no longer crashes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100