Admob 广告未显示在我的应用程序中。我感觉到广告正在加载,但由于我的布局安排,它没有显示。但我找不到它。这是我的代码
protected void onSetContentView() {
final RelativeLayout relativeLayout = new RelativeLayout(this);
final FrameLayout.LayoutParams relativeLayoutLayoutParams = new FrameLayout.LayoutParams(
RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT);
this.mRenderSurfaceView = new RenderSurfaceView(this);
mRenderSurfaceView.setRenderer(mEngine);
final FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.FILL_PARENT,
FrameLayout.LayoutParams.FILL_PARENT,Gravity.CENTER);
final android.widget.RelativeLayout.LayoutParams surfaceViewLayoutParams = new RelativeLayout.LayoutParams(layoutParams);
surfaceViewLayoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
relativeLayout.addView(this.mRenderSurfaceView, surfaceViewLayoutParams);
FrameLayout frameLayout = new FrameLayout(this);
adView = new AdView(this, AdSize.BANNER, "##############");
adView.refreshDrawableState();
adView.setVisibility(AdView.VISIBLE);
frameLayout.addView(adView);
relativeLayout.addView(frameLayout);
this.setContentView(relativeLayout, relativeLayoutLayoutParams);
}