nextcloud / nextcloud/notes-android

crash while rotating screen

Open
#2,654 0 comments 0 reactions 0 assignees View on GitHub

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:
Describe the bug
  1. open notes app
  2. open a note
  3. rotate phone/tab from portrait to landscape and backwards
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.