Я добавляю admob adview в активность моего приложения для Android:
мой код:
в XML-файле:
<Linearlayout
>
<Button />
<Button />
<com.google.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res/com.sos.emergency"
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
ads:adSize="BANNER"
ads:adUnitId="publisherid" />
</Linearlayout>
в моей деятельности:
AdView adview = (AdView)findViewById(R.id.adView);
adview.loadAd(new AdRequest());
adview.setAdListener(this);
И теперь я получаю следующую ошибку:
Logcat:
02-13 12:03:42.784: E/Ads(271): The android:configChanges value of the com.google.ads.AdActivity must include screenLayout.
02-13 12:03:42.784: E/Ads(271): The android:configChanges value of the com.google.ads.AdActivity must include uiMode.
02-13 12:03:42.784: E/Ads(271): The android:configChanges value of the com.google.ads.AdActivity must include screenSize.
02-13 12:03:42.784: E/Ads(271): The android:configChanges value of the com.google.ads.AdActivity must include smallestScreenSize.
02-13 12:03:42.784: E/Ads(271): You must have AdActivity declared in AndroidManifest.xml with configChanges.
И в моем файле манифеста я добавил следующее:
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation" />
скажите, пожалуйста, где мне нужно отредактировать код, чтобы показывать объявления в моем приложении.
Пожалуйста, посмотрите скриншот объявления, которое он показывает
Вы должны объявить AdActivity в AndroidManifest.xml с
configChange