我正在使用助手 android 应用程序创建一个 android 应用程序,但 Admob 广告有问题,一切正常,但是当我运行我的应用程序时,广告不显示
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111"
android:layout_gravity="center">
</com.google.android.gms.ads.AdView>
public class MainActivity extends Activity
{
private AdView mAdView;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MobileAds.initialize(this, new OnInitializationCompleteListener(){
@Override
public void onInitializationComplete(InitializationStatus initializationStatus){
}
});
mAdView = findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
}}
有什么帮助吗?