news-android icon indicating copy to clipboard operation
news-android copied to clipboard

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

Open maurerle opened this issue 1 year ago • 3 comments

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 avatar Nov 23 '23 08:11 maurerle

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

maurerle avatar Mar 17 '24 10:03 maurerle

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: https://github.com/nextcloud/news-android/blob/da3bfaaf2307204eba048d29de7c8e40455712a2/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsDetailActivity.java#L198-L201 I don't know about the side effects though.

cemrich avatar Jun 25 '24 13:06 cemrich

@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!

David-Development avatar Jul 03 '24 15:07 David-Development