Android 安卓MoPub SDK。代码段集成
我正在尝试将MoPub集成到我的应用程序中,但我不确定在我的活动的Android 安卓MoPub SDK。代码段集成,android,mopub,Android,Mopub,我正在尝试将MoPub集成到我的应用程序中,但我不确定在我的活动的onCreate()方法中的确切位置放置代码片段: mAdView = (MoPubView) findViewById(R.id.adview); mAdView.setAdUnitId("xxxxxxxxxxx"); // Enter your Ad Unit ID from www.mopub.com mAdView.loadAd(); 我把它放在调用super.onCreate(savedInstanceState)之前
onCreate()
方法中的确切位置放置代码片段:
mAdView = (MoPubView) findViewById(R.id.adview);
mAdView.setAdUnitId("xxxxxxxxxxx"); // Enter your Ad Unit ID from www.mopub.com
mAdView.loadAd();
我把它放在调用super.onCreate(savedInstanceState)之前还是之后代码>
是的,我知道这是一个非常琐碎的问题。在setContentView
之后编写代码,因为您在mAdView中使用findViewById