title: Android How to add ActionBar inside linear layout?
body: <p>How do you add an actionbar inside of a RelativeLayout? I'm using actionbarSherlock to add an action bar but I cant figure out how to add it inside of a linear layout. The reason is I want to add some elements above the actionbar and below it.</p>
  
  <p>edit:</p>
  
  <p>Using <a href="https://github.com/umano/AndroidSlidingUpPanel" rel="nofollow">this library</a> I can make a panel with another view slide up from the bottom. But the issue is that the actionbar stays attached at the top. Here is the code to make 2 panels in the layout.xml</p>
  
  <pre><code>    &lt;com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
      xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/sliding_layout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:gravity="bottom"
          sothree:panelHeight="68dp"
          sothree:shadowHeight="4dp"&gt;
  
  &lt;RelativeLayout
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_alignParentTop="true"
          android:layout_alignParentRight="true"
          android:layout_alignParentEnd="true"
          android:id="@+id/relativeone"&gt;
  
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:gravity="center"
              android:text="Main Content"
              android:textSize="16sp" /&gt;
  &lt;/RelativeLayout&gt;
  
  
  &lt;RelativeLayout
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_alignParentTop="true"
          android:layout_alignParentRight="true"
          android:layout_alignParentEnd="true"
          android:id="@+id/relativtwo"&gt;
          &lt;TextView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:gravity="center|top"
              android:text="The Awesome Sliding Up Panel"
              android:textSize="16sp" /&gt;
  
  &lt;/RelativeLayout&gt;
  
      &lt;/com.sothree.slidinguppanel.SlidingUpPanelLayout&gt;
  </code></pre>
  
  <p>This is what I tried but didnt work still</p>
  
  <pre><code>     &lt;com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto"
          xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/sliding_layout"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:gravity="bottom"
              sothree:panelHeight="68dp"
              sothree:shadowHeight="4dp"&gt;
  
      &lt;RelativeLayout
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:layout_alignParentTop="true"
              android:layout_alignParentRight="true"
              android:layout_alignParentEnd="true"
              android:id="@+id/relativeone"&gt;
  
  //I tried to place the menu in here but its completely wrong
      &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"&gt;
      &lt;item android:id="@+id/action_settings" android:title="@string/action_settings"
          android:orderInCategory="100" /&gt;
  &lt;/menu&gt;
              &lt;TextView
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center"
                  android:text="Main Content"
                  android:textSize="16sp" /&gt;
      &lt;/RelativeLayout&gt;
  
  
      &lt;RelativeLayout
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:layout_alignParentTop="true"
              android:layout_alignParentRight="true"
              android:layout_alignParentEnd="true"
              android:id="@+id/relativtwo"&gt;
              &lt;TextView
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:gravity="center|top"
                  android:text="The Awesome Sliding Up Panel"
                  android:textSize="16sp" /&gt;
  
      &lt;/RelativeLayout&gt;
  
          &lt;/com.sothree.slidinguppanel.SlidingUpPanelLayout&gt;
  </code></pre>