I want to put the advertisement in the activity footer, but it is at the top overlapping a list:
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView
android:id="@+id/list_slidermenu"
android:layout_width="280dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:listSelector="#4DA6FF"
android:background="#FFF"/>
<LinearLayout
android:id="@+id/listaPropaganda"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"/>
Java, in the oncreate of activity:
AdView ads = new AdView(this);
ads.setAdUnitId(ANUNCIO_ID);
ads.setAdSize(com.google.android.gms.ads.AdSize.BANNER);
LinearLayout layout = (LinearLayout) findViewById(R.id.listaPropaganda);
layout.addView(ads);
AdRequest request = new AdRequest.Builder().addTestDevice("1100").build();
ads.loadAd(request);
I want to put it in the footer and fill in all the space. How to do this?
<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ListView
android:id="@+id/list_slidermenu"
android:layout_width="280dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:listSelector="#4DA6FF"
android:background="#FFF"/>
<LinearLayout
android:id="@+id/listaPropaganda"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"/>