行 adView.setTesting(true); 给 ea 错误说方法不退出,代码 blocksetTesting adView = new AdView(this, AdSize.BANNER, "a14e10cb6b18825"); ad = new AdView(this, AdSize.BANNER, "a14e10cb6b18825");
// Lookup your LinearLayout assuming it’s been given
// the attribute android:id="@+id/mainLayout"
LinearLayout layout = (LinearLayout)findViewById(R.id.mainLayout);
// Add the adView to it
layout.addView(adView);
// Initiate a generic request to load it with an ad
adView.setTesting(true);
adView.loadAd(new AdRequest());