openHPI / xikolo-android

📱 Android App of the HPI MOOC Platform
https://play.google.com/store/apps/dev?id=7185448023325736337
GNU General Public License v3.0
41 stars 15 forks source link

CourseItemsActivity jumps to initial item after resumed #205

Closed tobiasrohloff closed 4 years ago

tobiasrohloff commented 4 years ago

When the CourseItemsActivity is started for a specific item, this position is automatically opened in the tab navigation. When the user goes to another item and then puts the activity into the background (e.g. by opening a video) and then opens the activity again it jumps to the initial item position instead of keeping the last one.

bengelhaupt commented 4 years ago

I was not able to reproduce this bug by simply pausing and then resuming the activity. Neither playing a video and then going back caused this bug. Both work fine for me and the last opened item is still selected.

What caused the behavior for me was: Select an item from Learnings in CourseActivity > switch to a video item > play it > go into PIP > navigate out of CourseItemsActivity > make the video large again > go back.

This happens because when starting the VideoPlayer, we supply the Intent of the CourseItemsActivity because the VideoPlayer would crash when trying to navigate back/up when the parent CourseItemsActivity had been closed. I case this happens, so when the back stack has been lost, this intent is started.

The bug can be solved by repacking the whole intent every time an item has been selected.

tobiasrohloff commented 4 years ago

Let's discuss this in person, I was able to reproduce this.

tobiasrohloff commented 4 years ago

It seems to be already fixed on master.