Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not enough space to show ad! when running within a TabActivity

Tags:

android

admob

I'm trying to use the newly released Google admob SDK (GoogleAdMobAdsSdkAndroid-4.0.4).

The following:

        LinearLayout layout = (LinearLayout)findViewById(R.id.my_layout);
        AdView adView = new AdView(this, AdSize.BANNER,"my_publisher_id");
        layout.addView(adView);
        AdRequest request = new AdRequest();
        request.setTesting(true);
        adView.loadAd(request);

is working just fine in an Activity. However, when I include the above Activity within a TabActivity, AdView stops working and says:

WARN/Ads(17559): Not enough space to show ad! Wants: <480, 75>, Has: <448, 495>

Any idea how can I include AdView within a TabActivity? Not necessarily within each Activity, I'd be happy with the AdView just on top of the Tabs, but that is not working neither.

Many TIA

like image 201
Dumitru Hristov Avatar asked Dec 12 '22 14:12

Dumitru Hristov


1 Answers

The problem was in the padding on the LinearLyout that is within the Tabhost. Removed padding and problem solved.

like image 155
Dumitru Hristov Avatar answered Jan 20 '23 03:01

Dumitru Hristov