title: How can i place admob ads above a LibGDX view
body: <p>I've read many tutorials such as this one:</p>
  
  <p><a href="https://github.com/libgdx/libgdx/wiki/Admob-in-libgdx" rel="nofollow">https://github.com/libgdx/libgdx/wiki/Admob-in-libgdx</a></p>
  
  <p>however I cant seem to get my head round one thing. They all use ads which overlap the game view and I would rather it went above, and my game view was just squished down. How can i go about doing this? I have tried using Linear Layout but that doesn't seem to work either</p>
  
  <p>this is my onCreate() method</p>
  
  <pre><code>@Override public void onCreate (Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          // Create the layout
          RelativeLayout layout = new RelativeLayout(this);
  
          // Do the stuff that initialize() would do for you
          requestWindowFeature(Window.FEATURE_NO_TITLE);
          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                  WindowManager.LayoutParams.FLAG_FULLSCREEN);
          getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
  
          // Create the libgdx View
          View gameView = initializeForView(new HelloWorld(), false);
  
          // Create and setup the AdMob view
          AdView adView = new AdView(this, AdSize.BANNER, "xxxxxxxx"); // Put in your secret key here
          adView.loadAd(new AdRequest());
  
          // Add the libgdx view
          layout.addView(gameView);
  
          // Add the AdMob view
          RelativeLayout.LayoutParams adParams = 
              new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, 
                      RelativeLayout.LayoutParams.WRAP_CONTENT);
          adParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
          adParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
  
          layout.addView(adView, adParams);
  
          // Hook it all up
          setContentView(layout);
      }
  </code></pre>