-3

i just discovered that on interstitial load at the background stopping my all sounds.

i got following in each activity resulting stopping any kinds of interstitial load at the background

public void displayInterstitial() {
    if (interstitial.isLoaded()) {
        interstitial.show();
    }
}

please help with it

thanks

1 Answers1

2

According to Google's best practices for interstitial ads:- https://developers.google.com/mobile-ads-sdk/docs/admob/android/interstitial

Remember to pause the action when displaying an interstitial. There are a number of different types of interstitial ads: text, image, video, and more. It's important to make sure that when your application displays an interstitial, it also suspends its use of some resources in order to allow the ad to take advantage of them. For example, when you make the call to display an interstitial, be sure to pause any audio output being produced by your app. You can resume playing sounds in the onAdClosed event handler, which will be invoked when the user has finished interacting with the ad. In addition, consider temporarily halting any intense computation tasks (such as a game loop) while the ad is being displayed. This will make sure the user doesn't experience janky graphics or stuttered video.

Summary: Sound is paused so that user can view ad without any issue. While you can definitely play the sound in background , I would advice not to do that as it would interfere with ads.

Akshit Rewari
  • 941
  • 2
  • 13
  • 26