AdMob over libGDX表面 - 与标题一起消失
当我使用标题运行活动时,Admob会显示regulary iver libGDX表面。 当我关闭这个活动名称:AdMob over libGDX表面 - 与标题一起消失
requestWindowFeature(Window.FEATURE_NO_TITLE);
的AdMob自败。任何人都有想法,为什么要这样做?
任何建议将有所帮助。先谢谢你。
代码在我的MainActivity
public class MainActivity extends AndroidApplication { private AdView adView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
cfg.useGL20 = false;
// requesting to turn the title OFF
//requestWindowFeature(Window.FEATURE_NO_TITLE);
// making it full screen
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
/* Your ad unit id. Replace with your actual ad unit id. */
final String AD_UNIT_ID = "00000000000000";
// Create an ad.
adView = new AdView(this);
adView.setAdSize(AdSize.BANNER);
adView.setAdUnitId(AD_UNIT_ID);
RelativeLayout layout = new RelativeLayout(this);
View gameView=initializeForView(new ZBGame(), cfg);
RelativeLayout.LayoutParams adParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
adParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
adParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
RelativeLayout.LayoutParams adParams1 = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
adParams1.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
adParams1.addRule(RelativeLayout.CENTER_HORIZONTAL);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
layout.addView(gameView, adParams);
layout.addView(adView, adParams1);
setContentView(layout);
//requestWindowFeature(Window.FEATURE_NO_TITLE);
}
private View initializeForView(Object initialize) {
// TODO Auto-generated method stub
return null;
}
回答:
删除此:
private View initializeForView(Object initialize){ // TODO Auto-generated method stub
return null;
}
以上是 AdMob over libGDX表面 - 与标题一起消失 的全部内容, 来源链接: utcz.com/qa/261913.html