I am trying to set up a listview for some actions that is displayed on a Navigation Drawer that opens from the right. The project will compile with no errors and I tried out my BaseAdapter on a ListView that is already in view and that works fine. There is no action bar in my app so the user has to open the drawer by sliding from the right edge of the screen. All the info to be displayed in the listview is handled in the adapter.
Here is what is in onCreate
that is related to the drawer (On the official tutorial it seemed the only reason they would reference the actual DrawerLayout is to give it a toggle on the action bar, which I don't have):
I am now getting a null pointer exception when I try to assign the adapter.
ListView drawerList = (ListView) findViewById(R.id.drawerList);
returns null
UPDATED CODE
ListView drawerList = (ListView) findViewById(R.id.drawerList);
SectionedAdapter DrawerAdapter = new SectionedAdapter(this);
drawerList.setAdapter(DrawerAdapter);
main_activity.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/left_drawer">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/drawer_frame">
<AllOfMyStuff/>
<FrameLayout/>
<!--Always returns null-->
<ListView android:id="@+id/drawerList"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="right"
android:background="#ff1f1f1f"
android:drawSelectorOnTop="true"/>
</android.support.v4.widget.DrawerLayout>