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

NewsDetailFragment is not initialized when switching to landscape mode in article view #1330

Open
maurerle opened this issue Nov 23, 2023 · 3 comments
Labels

Comments

@maurerle
Copy link

When i open an article (with the in app reader)
Then turn my device into landscape mode
Click on the "Open article website" Button on the bottom right
I get "NewsDetailFragment is not initialized" and can not open the website.

Leaving the article and going back to the article list helps.
Turning the device into portrait mode does not help though.

So it seems that the button to open the website breaks when turning the device around.
I had this issue for quite some time but could not link the cause :)

Latest f droid version

@maurerle
Copy link
Author

To reproduce this issue:

  1. open a news article (in-app-reader)
  2. turn device into landscape mode
  3. turn device into protrait mode
  4. click on "open article website" button
  5. see article not opened but message "NewsDetailFragment is not initialized"

Hope this clear list helps to reproduce this

@cemrich
Copy link
Contributor

cemrich commented Jun 25, 2024

I can reproduce this issue. This is caused by NewsDetailActivity::currentPosition not set after activity re-creation. I think removing the check around this line should fix the issue:

if (savedInstanceState == null) {
// Only do that when activity is started for the first time. Not on orientation changes etc..
pageChanged(item_id);
}
I don't know about the side effects though.

@David-Development
Copy link
Member

@cemrich Thank you for looking into it. From the comment the only side-effect I can think of would be that things break when you rotate the screen. If it worked fine in your test I think we could remove the check. Starting at the end of next month I'll be dedicating more time again to fix / improve the app as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants