android - How to push the layout up once the ad banner is shown? -


I have a relative layout in which:

  1. The element that is in the alliance of the original layout .
  2. Relative layout buttons with an app view and others like As is known, advertisements are sometimes unavailable or WIFI is off, so it is not wise to leave the advertisement is not available, while the ad space is empty. Therefore, when I see an advertisement banner, I want to automatically move the inner relative layout. How can I go about doing this?

What I did to solve this problem was adview embedded within an otherwise empty LinerLayout, default for visibility with ad view: Gone I added an AdListener to AdView and set "visible" to visible in the AdListener in the onAdLoaded method.

  & lt; LinearLayout Android: id = "@ + id / ad_wrapper" Android: Android: Orientation = "Vertical" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" & gt; Android: Ad = "@ + id / adView" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" ad: adSize = "SMART_BANNER" Android: visibility = "gone" /> & Lt; / LinearLayout & gt;  

and then

  adView.setAdListener (new AdListener () {@Override public void on Adoloaded () {super.onAdLoaded (); adView.setVisibility (See Visual);}});  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -