AdMob in a fragment

前端 未结 2 1046
孤城傲影
孤城傲影 2021-01-03 12:38

I\'m inserting an AdMob in my application. but I have a problem about it.

when I inserted some codes about it in Eclipse, I can see an error message about \"the con

2条回答
  •  無奈伤痛
    2021-01-03 13:01

    You have to write root before the findViewById:

    AdView mAdView = (AdView) root.findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().build();
    mAdView.loadAd(adRequest);
    

提交回复
热议问题