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

Resuming the app is closing the reader screen #440

Closed
LubomirGanchev opened this issue Jan 12, 2024 · 10 comments · Fixed by #459
Closed

Resuming the app is closing the reader screen #440

LubomirGanchev opened this issue Jan 12, 2024 · 10 comments · Fixed by #459
Labels
bug Something isn't working

Comments

@LubomirGanchev
Copy link

Describe the bug

We are upgrading our project to version 2.4.0 and came across a strange behaviour. If the app is minimized when the reader is opened and then open the app again from the app drawer, the app is resumed from the previous screen (bookshelf fragment for example) it's like closing the reader screen. If the app is resumed via recent task menu, it's working as expected. Reproduced on the test app - version 2.4.0 (it's fine on 2.3.0).

How to reproduce?

  1. Open book and minimize the app
  2. Resume the app by clicking it in the app drawer (it is working as expected if resumed from recent task menu)

Readium version

2.4.0

Android API version

33

Additional context

No response

@LubomirGanchev LubomirGanchev added bug Something isn't working triage Triage needed by maintainers labels Jan 12, 2024
@stevenzeck
Copy link
Contributor

It's been like this for a while actually, from this issue in the old test app repository: #245. You can try changing the android:clearTaskOnLaunch attribute in the app's AndroidManifest.xml file. to false, but I don't know if that would leave to further issues.

@mickael-menu
Copy link
Member

mickael-menu commented Jan 17, 2024

We don't experience this problem on Aldiko, despite using android:clearTaskOnLaunch="true". We're using an alpha version of 3.0, but I believe it's irrelevant. This is likely a regression in the test app, not the toolkit. Currently unsure of the cause, a git bisect may be necessary.

EDIT: We don't have this flag in Aldiko, I was looking at the wrong source.

@LubomirGanchev
Copy link
Author

Hi @mickael-menu. We do experience it in our app too (2.4.0) I just gave the test app as an example. I saw the issue linked by @stevenzeck, but since upgrading to the latest version is the first time we experience it, never before that.

@mickael-menu
Copy link
Member

I identified the commit that introduced the regression between 2.3.0 and 2.4.0. It's part of the Test App code in 92cafbf, but I'm not sure exactly which part. Any idea @qnga?

@LubomirGanchev Which portions of the Test App did you copy when updating to 2.4.0?

@mickael-menu mickael-menu removed the triage Triage needed by maintainers label Jan 30, 2024
@LubomirGanchev
Copy link
Author

I copied a lot of things, because I actually upgraded from 2.2.1 (skipped 2.3.0). Unfortunately the changes between these two versions were significant and can't really tell you one by one exactly what I copied.

@qnga
Copy link
Member

qnga commented Feb 2, 2024

I agree with Steven, clearTaskOnLaunch seems to be the solution. Setting it to true looks to be specifically designed to get the behavior we don't want. No idea why it used to work before. We should switch question to "why would we need this?". In the testapp, I see no good reason.

@qnga
Copy link
Member

qnga commented Feb 2, 2024

Thinking again, do we really not want this behaviour? It doesn't look absurd to me. If you open the app from the home, that's because you forget that you used it recently and want to start again from scratch, so going back to the library makes some sense.
This behavior doesn't seem to be very common in my apps though, even when the same reasoning could apply (it's not the default one after all).

@mickael-menu
Copy link
Member

@LubomirGanchev You need to remove the android:clearTaskOnLaunch flag from your AndroidManifest.xml, see the rationale in the PR #459.

@LubomirGanchev
Copy link
Author

Hey @mickael-menu. I looked into this and saw that we don't have android:clearTaskOnLaunch in our manifest

@mickael-menu
Copy link
Member

This fixed the issue in the Test App. I'm not sure what the problem is in your application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants