Skip to content

fix: PDF reading position not being saved when app goes to background - #75

Open
mindfreq wants to merge 1 commit into
artcraft-android:mainfrom
mindfreq:main
Open

mindfreq wants to merge 1 commit into
artcraft-android:mainfrom
mindfreq:main

Conversation

@mindfreq

Copy link
Copy Markdown

Problem

When opening a PDF file, navigating to another page, and pressing the Home button, the last reading position was not saved correctly. Reopening the same PDF could start from the beginning instead of the last viewed page.

Solution

Updated "onPause()" to capture and save the current reading position when the app goes into the background.

Added the following methods to "AppViewModel":

  • "capturePlace()": Captures the current reading position.
  • "storePlace()": Stores the reading position for later restoration.
  • "Place": Holds the saved reading position data.

Expected Result

When reopening a PDF file, the reader should restore the last viewed page instead of starting from the beginning.

@mindfreq mindfreq changed the title Fix PDF reading position not being saved when app goes to background fix: PDF reading position not being saved when app goes to background Nov 18, 2026
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 this pull request may close these issues.

1 participant