title: How to add a ScrollView with multiple ListViews to a drawer layout (Navigation Drawer)
body: <p>I am attempting to add a navigation drawer to k9-mail, and in doing so am trying to create a navigation drawer with three listviews, and I want each listview to use the same scrollbar, so they are stationary, except they all scroll together. Basically I want the ListViews to act like one list, scrolling together and stacked on top of each other. However, whenever I try to add the ListViews into a ScrollView via <a href="https://stackoverflow.com/a/13796159/3171509">this answer</a>, I get an error. Now how can I use a ScrollView in a DrawerLayout without it throwing an error?</p>
  
  <p>Error it throws</p>
  
  <pre><code>08-13 11:11:33.148: E/AndroidRuntime(17586): FATAL EXCEPTION: main
  08-13 11:11:33.148: E/AndroidRuntime(17586): Process: com.bernard.beaconportal.activities, PID: 17586
  08-13 11:11:33.148: E/AndroidRuntime(17586): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bernard.beaconportal.activities/com.bernard.beaconportal.activities.activity.MessageList}: java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.support.v4.widget.DrawerLayout$LayoutParams
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2225)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2274)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at android.app.ActivityThread.access$800(ActivityThread.java:145)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at android.os.Handler.dispatchMessage(Handler.java:102)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at android.os.Looper.loop(Looper.java:136)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at android.app.ActivityThread.main(ActivityThread.java:5144)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at java.lang.reflect.Method.invokeNative(Native Method)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at java.lang.reflect.Method.invoke(Method.java:515)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at dalvik.system.NativeStart.main(Native Method)
  08-13 11:11:33.148: E/AndroidRuntime(17586): Caused by: java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.support.v4.widget.DrawerLayout$LayoutParams
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at android.support.v4.widget.DrawerLayout.isDrawerView(DrawerLayout.java:968)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at android.support.v4.widget.DrawerLayout.closeDrawer(DrawerLayout.java:1169)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at com.bernard.beaconportal.activities.activity.MessageList.selectItem_Inbox(MessageList.java:3048)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at com.bernard.beaconportal.activities.activity.MessageList.onCreate(MessageList.java:706)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at android.app.Activity.performCreate(Activity.java:5434)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2179)
  08-13 11:11:33.148: E/AndroidRuntime(17586):    ... 11 more
  </code></pre>
  
  <p>xml file for the drawer</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v4.widget.DrawerLayout 
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/drawer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#ffffff" &gt;
  
      &lt;FrameLayout
          android:id="@+id/content_frame"
          android:layout_width="wrap_content"
          android:layout_height="match_parent" 
           android:background="@color/white"
          &gt;
          &lt;com.bernard.beaconportal.activities.view.ViewSwitcher 
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/container"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" 
  
          android:background="@color/white"&gt;
  
      &lt;FrameLayout
          android:id="@+id/message_list_container"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" 
         android:clickable="true"
          android:background="@color/white"/&gt;
  
      &lt;FrameLayout
          android:id="@+id/message_view_container"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" 
          android:clickable="true"
          android:background="@color/white"/&gt;
  
  &lt;/com.bernard.beaconportal.activities.view.ViewSwitcher&gt;
  
      &lt;/FrameLayout&gt;
  
  
      &lt;com.bernard.beaconportal.activities.activity.VerticalScrollview
          android:layout_height="match_parent"
      android:layout_width="wrap_content"
  
          &gt;
  
      &lt;LinearLayout
      android:id="@+id/left_drawer"
      android:layout_height="match_parent"
      android:layout_width="320dp"
      android:orientation="vertical"
      android:layout_gravity="start"
      android:background="#ffffff" 
      android:clickable="true"&gt;
  
  
  
      &lt;ListView
          android:id="@+id/listview_inbox"
         android:layout_weight="1"
          android:layout_height="wrap_content" 
          android:layout_width="320dp"
      android:orientation="vertical"
      android:layout_gravity="start"
      android:background="#ffffff"
          android:minHeight="64dip"
         android:layout_alignBottom="@+id/Person"
          android:choiceMode="singleChoice"
          android:divider="#ECF0F1"
          android:dividerHeight="1dp"       
          android:listSelector="@drawable/list_selector"
          /&gt;
  
      &lt;ListView
          android:id="@+id/listview_drawer"
         android:layout_weight="1"
          android:layout_height="wrap_content" 
          android:layout_width="320dp"
      android:orientation="vertical"
      android:layout_gravity="start"
      android:background="#ffffff"
          android:minHeight="64dip"
         android:layout_alignBottom="@+id/Person"
          android:choiceMode="singleChoice"
          android:divider="#ECF0F1"
          android:dividerHeight="1dp"       
          android:listSelector="@drawable/list_selector"
          /&gt;
  
      &lt;ListView
          android:id="@android:id/list"
         android:layout_weight="1"
          android:layout_height="wrap_content" 
          android:layout_width="320dp"
      android:orientation="vertical"
      android:layout_gravity="start"
      android:background="#ffffff"
          android:minHeight="64dip"
         android:layout_alignBottom="@+id/Person"
          android:choiceMode="singleChoice"
          android:divider="#ECF0F1"
          android:dividerHeight="1dp"       
          android:listSelector="@drawable/list_selector"
          /&gt;
  
     &lt;/LinearLayout&gt;
  
    &lt;/com.bernard.beaconportal.activities.activity.VerticalScrollview&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p>I also tried setting that to the scrollview (mDrawerLayout.closeDrawer(mScrollView);), and that threw another error.</p>
  
  <pre><code>08-15 17:19:57.286: E/AndroidRuntime(2719): FATAL EXCEPTION: main
  08-15 17:19:57.286: E/AndroidRuntime(2719): Process: com.bernard.beaconportal.activities, PID: 2719
  08-15 17:19:57.286: E/AndroidRuntime(2719): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bernard.beaconportal.activities/com.bernard.beaconportal.activities.activity.MessageList}: java.lang.NullPointerException
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2225)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2274)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at android.app.ActivityThread.access$800(ActivityThread.java:145)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at android.os.Handler.dispatchMessage(Handler.java:102)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at android.os.Looper.loop(Looper.java:136)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at android.app.ActivityThread.main(ActivityThread.java:5144)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at java.lang.reflect.Method.invokeNative(Native Method)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at java.lang.reflect.Method.invoke(Method.java:515)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at dalvik.system.NativeStart.main(Native Method)
  08-15 17:19:57.286: E/AndroidRuntime(2719): Caused by: java.lang.NullPointerException
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at android.support.v4.widget.DrawerLayout.isDrawerView(DrawerLayout.java:968)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at android.support.v4.widget.DrawerLayout.closeDrawer(DrawerLayout.java:1169)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at com.bernard.beaconportal.activities.activity.MessageList.selectItem_Inbox(MessageList.java:3151)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at com.bernard.beaconportal.activities.activity.MessageList.onCreate(MessageList.java:718)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at android.app.Activity.performCreate(Activity.java:5434)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2179)
  08-15 17:19:57.286: E/AndroidRuntime(2719):     ... 11 more
  08-15 17:20:01.476: E/k9(2719): Unable to open connection for Lincoln:Drafts/Thread-1312/conn1105736992
  </code></pre>
  
  <p>Activity that contains the Navigation Drawer is located here: <a href="http://pastebin.com/F7ZF3s5M" rel="nofollow noreferrer">http://pastebin.com/F7ZF3s5M</a></p>