Reputation: 21
I have a "trivia" kind of game which only allows user to play in "Portrait" orientation. As you know, android activities automatically restarted when the orientation changes.
My game asks 20 questions to user in a randomized order. And there is a button that the user can get "hints" with watching rewarded video ads. However, AdMob sends "Landscape" videos, sometimes. And for that reason, after the video has finished, my activity starts from the 1st question, again.
How can I restrict AdMob from sending "Landscape" orientated video ads? I could not find anything on AdMob help page. Or, can I make it via coding? I am sure that restart thing is about orientation change because when AdMob sends "Portrait" Ads, game goes well from where it was before the video.
Thanks for your help!
Upvotes: 1
Views: 1929
Reputation: 911
Add "configChanges" property in the activity tag in "AndroidManifest" to prevent "activity" from restarting due to orientation change caused by the intersitial video.
Upvotes: 1
Reputation: 20140
watching rewarded video ads start a new Activity then your Activity will be in background and when your video finished or close your Ad then your paused Activity come in foreground.
So don't worry about your App start from beginning. Make sure you're not calling onDestroy()
on your Activity and having all appropriate configuration in Manifest
file.
https://groups.google.com/forum/#!topic/google-admob-ads-sdk/BJ9XGyDMGHk
Upvotes: 0