Abhinandan Chakraborty Abhinandan Chakraborty - 1 year ago 146
Android Question

Initialize Google Mobile Ads SDK (Admob) only once?

if we need to initialise Admob SDK then should we initialise it for once at MainActivity.class or there's need to initialise it in every activity in which Admob Ads are present?

As per this link : https://firebase.google.com/docs/admob/android/quick-start "To initialize the Google Mobile Ads SDK at app launch, call MobileAds.initialize() in the onCreate() method of the MainActivity class."

So should we call it only once for every Ads in different activity?

Answer Source

Your app only needs to call that method once, typically at startup in the first activity. There's no need to call it twice during a single execution of the app, or in every single activity.

See the official reference docs for details.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download