How to avoid re-loading of Admob ads upon configuration change and starting an Activity?
I don't see clear way how to cache ordinary ads. Nor singleton, nor viewmodel won't help, we can't cache/retain the view itself and there is no public ad object to retain.
However there is AdLoader
using which one can load native ads, and retain loaded UnifiedNativeAd
object. Then it can be used to set ad in view.
Other ad sdks provide way to prefetch ads though.
P.S. dunno why stack brought this in search results for "android viewmodel" query