You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am trying to find an example using a rather trivial case of screen rotation when playing an ad. But in the examples, the manifest contains:
android parameter: configChanges = "orientation", so when rotate, views does not recreating.
In my case, without android parameter: configChanges = "orientation". When I rotate the screen, I lose information about the advertisement.
not_work.mp4
To solve the problem, I save playerView and add it to container when views recreate.
But this method looks pretty crutch:
(viewModel.playerView?.parent as ViewGroup).removeView(viewModel.playerView)
findViewById(R.id.container).addView(viewModel.playerView)
Hello, I am trying to find an example using a rather trivial case of screen rotation when playing an ad. But in the examples, the manifest contains:
android parameter: configChanges = "orientation", so when rotate, views does not recreating.
In my case, without android parameter: configChanges = "orientation". When I rotate the screen, I lose information about the advertisement.
not_work.mp4
To solve the problem, I save playerView and add it to container when views recreate.
But this method looks pretty crutch:
(viewModel.playerView?.parent as ViewGroup).removeView(viewModel.playerView)
findViewById(R.id.container).addView(viewModel.playerView)
Looks like that:
work.mp4
Here's a repository with an example described
https://github.com/Miklesam/IMA-SDK-Rotate
Please help me find the correct method when rotating the screen.
Thanks for all your help.