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?
The best place to initialize the Ads SDK is from the onCreate
method of your Application. If you don't have an Application class yet, I recommend your create one.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With