AdMob AdView shows up but the rest of my layout is gone (Android)?

Your initial LinearLayout should specify android:orientation="vertical and then make the AdView height wrap_content instead (or 50dp - this is what I have in one of my apps). This should be sufficient. The ScrollView is correct as you have it, with wrap_content and android:layout_weight="1.

Your initial LinearLayout should specify android:orientation="vertical", and then make the AdView height wrap_content instead (or 50dp - this is what I have in one of my apps). This should be sufficient. The ScrollView is correct as you have it, with wrap_content and android:layout_weight="1".

1 Yep, this works much better than the solution I cobbled together and is a lot less of a pain in the ass. Thank you! – BigE Jun 22 at 19:39.

You made the AdView height fill_parent. Make it wrap_content instead and the height of the ScrollView to be fill_parent.

Good catch - that was a silly mistake. However, fixing it still doesn't fix the problem. I even tried uninstalling/reinstalling from the emulator and no dice.

– BigE Jun 21 at 6:22 This solution should work if you don't set ScrollView to fill_parent – Kenton Price Sep 16 at 14:32.

Okay, found a way to make this work. Got kind of maddening there for a while. The method I found that worked was switching to a RelativeLayout, loading the ad programmatically and throwing in a ViewStub that inflates a view the same height as the ad when the ad loads (using AdListener).

I suspect there's a more elegant way to do this, but this definitely works for me. Main. Xml: snip irrelevant views ad_mob_layout.

Xml: main. Java: public class main extends Activity implements AdListener { @Override public void onCreate(Bundle savedInstanceState) { super. OnCreate(savedInstanceState); setContentView(R.layout.

Main); //programattically create adview AdView adView = new AdView(this, AdSize. BANNER, "a14e0010a66c749"); //find main layout and add adview to it RelativeLayout layout = (RelativeLayout)findViewById(URL1. MainLayout); layout. AddView(adView); //set up ad request with test devices/emulator AdRequest request = new AdRequest(); request.

AddTestDevice(AdRequest. TEST_EMULATOR); adView. LoadAd(request); adView.

SetAdListener(this); } @Override public void onReceiveAd(Ad arg0) { @SuppressWarnings("unused") View stubToInflate = ((ViewStub)this. FindViewById(URL1. MainPlaceholder)).inflate(); } Hope this helps if anyone else is having this problem!

Trying to get an AdMob AdView to show up above a ScrollView and have said ScrollView fill up the remainder of the screen. So far all I've been able to do is get the AdView to show up and load the test ad properly, but then the rest of the screen is just black. I can't figure out where the hell the ScrollView's gone.

I've tried a dozen different solutions, including loading it programattically instead of via main. Xml and changing the height of the ScrollView to wrap_content, but still having the same issue.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions