我使用以下代码在活动的 onCreate() 中显示广告由于我的活动显示时间较长,我可以刷新广告吗?还是会自动刷新它们?我什至需要更改它们还是不应该打扰它?
//only ask for test ad, in emulator , should remove this later in real device
AdRequest adRequest = new AdRequest();
//adRequest.addTestDevice(AdRequest.TEST_EMULATOR); // Emulator
//adRequest.addTestDevice("TEST_DEVICE_ID");
// Create the adView
adView = new AdView(this, AdSize.BANNER, "908908098098");
// Lookup your LinearLayout assuming it’s been given
// the attribute android:id="@+id/mainLayout"
LinearLayout layout = (LinearLayout)findViewById(R.id.adLayout);
// Add the adView to it
layout.addView(adView);
// Initiate a generic request to load it with an ad
adView.loadAd(adRequest);