Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Empty space after AdMob disappear

Tags:

android

layout

I have layout structure:

<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical" >
  <com.google.ads.AdView 
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   ads:adSize="BANNER"
  />
    
  <LinearLayout style="@style/TitleBar"
   android:layout_width="fill_parent"
   android:layout_height="45dip"
    // title bar
  </LinearLayout>
  
<RelativeLayout
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical"
  // main layout with all needed elements and background!" >
  
</RelativeLayout>
</LinearLayout>

Everything look fine, until my AdMob disappered. Then I can see empty black region with admob size.

UPDATE: my screen shot: enter image description here

normally I cas see here ad block, but when I get onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory.) ad disappers and my layout not fill all screen.

like image 885
Anton Derevyanko Avatar asked Jun 16 '11 18:06

Anton Derevyanko


3 Answers

Another way to look at this would be to set up your own 'house ad' in AdMob to target your app. Then when AdMob doesn't have an ad to serve it would display your own ad to 'fill the blank'.

like image 188
Smugrik Avatar answered Nov 08 '22 19:11

Smugrik


Just to confirm does your adView has this as height parameter?

android:layout_height="wrap_content"
like image 33
PravinCG Avatar answered Nov 08 '22 17:11

PravinCG


Use the Set Visibility function to remove it from the layout.

SetVisibility()

Check this post also on hiding the AdView

like image 1
Chris Lucian Avatar answered Nov 08 '22 19:11

Chris Lucian