English 中文(简体)
为什么我的广告广告没出现?
原标题:Why aren t my admob ads showing up?

我跟踪了关于如何添加广告的文件,然而我似乎遗漏了某些东西,因为样本应用程序正在起作用。 广告账户报告说,我的应用程序正在请求发布广告,我在记录簿中看到这些请求,但广告没有出现。

这是Create的代码:

this.adView = new AdView(this, AdSize.BANNER, MY_UNIT_ID);
LinearLayout layout = (LinearLayout) findViewById(R.id.appLayout);
layout.addView(adView);
AdRequest ad = new AdRequest();
ad.addTestDevice("DEVICE_ID");
this.adView.loadAd(ad);

这是我的布局:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:id="@+id/appLayout"
     >

   <ListView
       android:id="@+id/myListView"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:scrollbars="vertical" 
       >
   </ListView>
</LinearLayout>

在机器人操纵器中,XML:

我宣布了2项必要的休假:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

活动和活动:

<activity android:name="com.google.ads.AdActivity"                android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

我错过了什么?

我同时附上一个记录簿

05-26 21:04:01.761: I/Ads(6186): adRequestUrlHtml: removed requestHtml also
05-26 21:04:02.171: I/Ads(6186): Received ad url: removed ad url from here
05-26 21:04:02.752: I/Ads(6186): onReceiveAd()
最佳回答

OK,看来我也实施了Resume () 。 如果您同时实施了Create和Resume, 则整个ad装载应该在那里完成。

问题回答

这是因为,您的观点不可见, 您的 ListView 显示我们占用了全部空间。 请更改它是否有效 。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签