3

I'm getting this exception when I try to open the Navigation Drawer from the right Exception: java.lang.IllegalArgumentException: No drawer view found with gravity RIGHT at

mDrawerLayout.openDrawer(Gravity.RIGHT);

My Layout file :

<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_gravity="right"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- Framelayout to display Fragments -->
    <FrameLayout
        android:id="@+id/frame_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <!-- Listview to display slider menu -->
    <ListView
        android:id="@+id/list_slidermenu"
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="right"
        android:choiceMode="singleChoice"
        android:divider="@color/list_divider"
        android:dividerHeight="1dp"        
        android:listSelector="@drawable/list_selector"
        android:background="@color/list_background"/>
</android.support.v4.widget.DrawerLayout>

Is there anything I'm doing Wrong? Thanks for your Assistance.

user3458008
  • 329
  • 3
  • 9
  • 21

1 Answers1

6

Anyways I got it working myself,For others who are finding difficulty to solve, Here's what I have did, I changed android:layout_gravity="right" of the list view to android:layout_gravity="end" it started working fine.

user3458008
  • 329
  • 3
  • 9
  • 21