The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
Describe the bug
Sometimes the "previous" button used for paginations shows in the first page, and crashes with the following exception when clicked
org...rtregister.fhircore.mwcoreDev E FATAL EXCEPTION: main
Process: org.smartregister.fhircore.mwcoreDev, PID: 16413
java.lang.IllegalStateException: Can't call goToPreviousPage() if no preceding page is enabled
at com.google.android.fhir.datacapture.QuestionnaireViewModel.goToPreviousPage$datacapture_release(QuestionnaireViewModel.kt:483)
at com.google.android.fhir.datacapture.QuestionnaireFragment.onViewCreated$lambda$1(QuestionnaireFragment.kt:98)
at com.google.android.fhir.datacapture.QuestionnaireFragment.$r8$lambda$Uy3n-EtWjyq7ZdNYJNMoLcmE2DA(Unknown Source:0)
at com.google.android.fhir.datacapture.QuestionnaireFragment$$ExternalSyntheticLambda0.onClick(Unknown Source:2)
at android.view.View.performClick(View.java:7448)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1218)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28305)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Component
SDC library
Expected behavior
Previous button shouldn't show up on the first page
Screenshots
Additional context
It seems to happen when the questionnaire has items (in our case, hidden) not marked with extension for page, coming before ones with page
Describe the bug Sometimes the "previous" button used for paginations shows in the first page, and crashes with the following exception when clicked
Component SDC library
Expected behavior Previous button shouldn't show up on the first page
Screenshots
Additional context It seems to happen when the questionnaire has items (in our case, hidden) not marked with extension for page, coming before ones with page
example.json
Would you like to work on the issue? Yes