1
레이아웃에서 2 개의 AdView를 만들어야합니다. 레이아웃의 위쪽과 아래쪽 모두. 나는 한 명을 위해 일했다. 이제 레이아웃의 맨 아래에 AdView를 하나 더 추가하려고합니다. 그것을 성취하는 방법? 미리 감사드립니다. 레이아웃의 상위 AdView에 대한 내 코드는 다음과 같습니다.Android 복수 레이아웃의 Adview
@SuppressWarnings({ "deprecation", "unused" })
public class BannerEssentials extends Activity{
WebView webview;
static String MY_BANNER_UNIT_ID="google";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// BANNER 1
// Lookup R.layout.main
AbsoluteLayout layout = (AbsoluteLayout)findViewById(R.id.linearLayout);
// Create the adView
// Please replace MY_BANNER_UNIT_ID with your AdMob Publisher ID
AdView adView = new AdView(this, AdSize.BANNER, MY_BANNER_UNIT_ID);
// Add the adView to it
layout.addView(adView);
// Initiate a generic request to load it with an ad
AdRequest request = new AdRequest();
request.setTesting(true);
adView.loadAd(request)
그냥 여담으로, AbsoluteLayout 조심 수 있습니다. 그것은 이유가 없어 졌으므로 - 아주 좋지 않습니다. – yep