Android 导航抽屉问题

Android 导航抽屉问题,android,xml,android-layout,user-interface,navigation-drawer,Android,Xml,Android Layout,User Interface,Navigation Drawer,我一直在遵循谷歌的官方指南来创建一个简单的导航抽屉。到目前为止,我已将我的主要_Activity.xml布局更改为: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" andro

我一直在遵循谷歌的官方指南来创建一个简单的导航抽屉。到目前为止,我已将我的主要_Activity.xml布局更改为:

<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">
    <!-- The main content view -->
    <FrameLayout
        android:id="@+id/content_frame"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    <!-- The navigation drawer -->
    <ListView android:id="@+id/drawer_list"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:choiceMode="singleChoice"
        android:divider="@android:color/transparent"
        android:dividerHeight="0dp"
        android:background="#111"/> 
</android.support.v4.widget.DrawerLayout>

然后,我在MainActivity.java上添加了以下内容:

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerList = (ListView) findViewById(R.id.drawer_list);

    // Creating an ArrayAdapter to add items to the listview mDrawerList
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(getBaseContext(), 
            R.layout.drawer_list_item, mOptions);

    // Setting the adapter on mDrawerList
    mDrawerList.setAdapter(adapter);
mDrawerLayout=(抽屉布局)findViewById(R.id.drawer\u布局);
mDrawerList=(ListView)findViewById(R.id.drawer\u列表);
//创建ArrayAdapter以将项添加到listview mDrawerList
ArrayAdapter=新的ArrayAdapter(getBaseContext(),
R.布局图、抽屉清单、项目、操作);
//在mDrawerList上设置适配器
mDrawerList.setAdapter(适配器);
我还使用以下内容创建了XML抽屉列表项

 <TextView xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@android:id/text1"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:textAppearance="?android:attr/textAppearanceListItemSmall"
     android:gravity="center_vertical"
     android:paddingLeft="16dp"
     android:paddingRight="16dp"
     android:textColor="#fff"
     android:background="?android:attr/activatedBackgroundIndicator"
     android:minHeight="?android:attr/listPreferredItemHeightSmall"/>


但我仍然一无所获,甚至连一个错误都没有。它只是不起作用,我想我错过了一些简单的,谢谢

请更新问题并插入xml布局。mOptions中是否有任何内容?私有字符串[]mOptions={“Login”,“Search”};