Dual sided DrawerLayout, Left side works - Right doesn't

113 Views Asked by At

I am using DrawerLayout. I have two ListView for both side. Left side is working properly by clicking left-top corner button on ActionBar. Right side is working too.But Right side working only sliding from left to right swipe. I want to put a button to right-top corner of ActionBar to open right side (just like left-top button on ActionBar). How can I do that?

Here is my ActionBarDrawerToggle codes I am using;

public class MainActivity extends ActionBarActivity {

private ActionBarDrawerToggle mDrawerToggle;

//....

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //....

        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
                R.drawable.sidebar, R.string.drawer_open,
                R.string.drawer_close) {
            public void onDrawerClosed(View view) {
                invalidateOptionsMenu();
                Toast.makeText(getApplicationContext(),"Menu closed",Toast.LENGTH_SHORT).show();
            }

            public void onDrawerOpened(View drawerView) {
                invalidateOptionsMenu();
                Toast.makeText(getApplicationContext(),"Menu opened",Toast.LENGTH_SHORT).show();
            }
        };
        mDrawerLayout.setDrawerListener(mDrawerToggle);
   }
}
0

There are 0 best solutions below