title: How to add a footer to gridview layout in android
body: <p>I need to add a footer view of some kind to a gridview layout in android, there is no official documentation that I can find for this and I have not been able to find a method that actually works in my google searches, has anyone achieved anything like this? I need to make a button that will show up the bottom of the gridview so that I can add more photos onclick, sort of like the below example from instagram, any help would go a long way thanks!</p>
  
  <p><img src="https://i.stack.imgur.com/Xhgro.png" alt="enter image description here"></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical" &gt;
  
  &lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal"
      android:layout_margin="5dp" &gt;
  
      &lt;ImageView
          android:id="@+id/profile_user_avatar"
          android:layout_width="48px"
          android:layout_height="48px"
          android:adjustViewBounds="true"
          android:layout_marginTop="5dp" /&gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical" 
          android:paddingLeft="5dp"&gt;
  
          &lt;TextView
              android:id="@+id/profile_realname"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:gravity="left"
              android:textSize="20dp"
              android:textStyle="bold"
               /&gt;
  
          &lt;TextView
              android:id="@+id/profile_username"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginBottom="2dp"
              android:gravity="left" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:orientation="horizontal" &gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_margin="5dp"
          android:layout_weight="1"
          android:orientation="vertical" &gt;
  
          &lt;TextView
              android:id="@+id/tweets_stat"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:background="@color/button_color_light"
              android:gravity="center"
              android:padding="10dp"
              android:textSize="20dp"
              android:textStyle="bold"
              android:textColor="#FFFFFF" /&gt;
  
          &lt;TextView
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:background="@color/button_color_dark"
              android:gravity="center"
              android:padding="10dp"
              android:text="Tweets"
              android:textSize="15dp"
              android:textStyle="bold"
              android:textColor="#FFFFFF" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_margin="5dp"
          android:layout_weight="1"
          android:orientation="vertical" &gt;
  
          &lt;TextView
              android:id="@+id/followers_stat"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:background="@color/button_color_light"
              android:gravity="center"
              android:padding="10dp"
              android:textSize="20dp"
              android:textStyle="bold"
              android:textColor="#FFFFFF" /&gt;
  
          &lt;TextView
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:background="@color/button_color_dark"
              android:gravity="center"
              android:padding="10dp"
              android:text="Followers"
              android:textSize="15dp"
              android:textStyle="bold"
              android:textColor="#FFFFFF" /&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_margin="5dp"
          android:layout_weight="1"
          android:orientation="vertical" &gt;
  
          &lt;TextView
              android:id="@+id/following_stat"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:background="@color/button_color_light"
              android:gravity="center"
              android:padding="10dp"
              android:textSize="20dp"
              android:textStyle="bold"
              android:textColor="#FFFFFF" /&gt;
  
          &lt;TextView
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:background="@color/button_color_dark"
              android:gravity="center"
              android:padding="10dp"
              android:text="Following"
              android:textSize="15dp"
              android:textStyle="bold"
              android:textColor="#FFFFFF" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  
  &lt;GridView
      android:id="@+id/gridView1"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:columnWidth="90dp"
      android:gravity="center"
      android:horizontalSpacing="10dp"
      android:numColumns="auto_fit"
      android:stretchMode="columnWidth"
      android:verticalSpacing="10dp" &gt;
  &lt;/GridView&gt;
  
  &lt;Button
      android:id="@+id/profile_button"
      style="@style/TextAppearance.Button"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginBottom="30dp"
      android:layout_marginTop="30dp"
      android:background="@drawable/button_background"
      android:text="Load more photos" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>