Open prat-z opened 6 years ago
@prat-z How you save and restore the PlaybackInfo using onActivityResult()? The tmpStates should do nothing related to the Activity I think.
@eneim I am calling the method savePlaybackInfo()
of Container
class in onActivityResult()
.
The onWindowVisibilityChanged
method of Container
is called after that, which resets my change.
@prat-z Do you have orientation change during the transition?
I tried with my demo (the CustomLayoutActivity/CustomLayoutFragment) and it works fine, though the default behaviour doesn't have orientation change. Also, do you retain your Activity in config change? (by setting the flag 'configChange' in manifest).
@eneim Yes, orientation change is happening in my case. The orientation of the next screen is fixed to Landscape, without setting flags 'configChange'.
@prat-z I see, so switching to full-screen = the App will switch to landscape mode? And if user turn off full-screen, does your app go back to portrait? Or it stays in landscape mode from there? Can you double check my CustomLayoutActivity demo? Of can you give a few lines of code of your Activity or Fragment where you start the full-screen? Especially the way you use onActivityResult. Will take some time on this asap.
Playback info is getting reset to previous value when setting the value in onActivityResult().
In my use case, I have 2 activities, one of them having a feed containing videos and other being the full screen video activity. When returning back from full screen to the feed, I want to save the playback info of the video. I am doing this in onActivityResult().
The problem is that the value gets rewritten to the old state, from
tmpStates
whenonWindowVisibilityChanged
is called forContainer.java
, which is afteronActivityResult()
.Am I using it the wrong way? If yes, whats the right to achieve this. If no, what is the workaround for this.
Thanks in advance.