我正在尝试在我的应用程序中添加 addwhirl 但我没有显示任何广告,我正在做以下事情
清单.xml
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
布局.xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/com.liverpool.activities"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/layout_ad" />
在我正在做的代码中
try
{
AdManager.setTestDevices(new String[] { AdManager.TEST_EMULATOR });
LinearLayout layout = (LinearLayout) findViewById(R.id.layout_ad);
AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "SDK key from adwhirl");
Display d = this.getWindowManager().getDefaultDisplay();
RelativeLayout.LayoutParams adWhirlLayoutParams = new RelativeLayout.LayoutParams(d.getWidth(), 72);
layout.addView(adWhirlLayout, adWhirlLayoutParams);
}
catch (Exception e)
{
}
我在哪里做错了?