Saturday, January 19, 2013

Android admob positioning ad on BOTTOM

First off- I have an admob adView set up but I need to create it dynamically due to a bug in the latest release of course.

I want the ad on the bottom of the screen, and I have a linearLayout which is set to the bottom BUT there are is a restrictions which have to be otherwise the ad wont load:
1) I need to LinearLayout to be a certain height (NOT wrap content)

This all works fine with a test ad, but the problem is...I was going to put this layout in a RelativeLayout so that I can align it to the bottom, but as soon as i do- I don't see any ad...

here is my code onCreate:

    adView = new AdView(this, AdSize.BANNER, "xxx");      LinearLayout layout = (LinearLayout)findViewById(R.id.adView);      layout.addView(adView);       AdRequest adRequest = new AdRequest();     adRequest.addTestDevice(AdRequest.TEST_EMULATOR);     adRequest.addTestDevice("5554");         adView.loadAd(adRequest); 

As i said, the above code works perfectly fine, but i would like to align this on the bottom and inside a relativeLayout, but it has to be done dynamically...

Source: http://stackoverflow.com/questions/14392382/android-admob-positioning-ad-on-bottom

glen campbell jerusalem artichoke bud shootout aretha franklin stevie wonder new orleans weather new orleans weather

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.