0

I am currently playing around with the drawer in my new app and when I am setting up my drawer I am using the code

mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.drawer_open, R.string.drawer_close, 0) {

         /** Called when a drawer has settled in a completely open state. */
         public void onDrawerOpened(View drawerView) {
             super.onDrawerOpened(drawerView);

         }

         /** Called when a drawer has settled in a completely closed state. */
         public void onDrawerClosed(View view) {
             super.onDrawerClosed(view);

         }
     };
     mDrawerToggle.setDrawerIndicatorEnabled(true);
     mDrawerLayout.setDrawerListener(mDrawerToggle);

However eclipse keeps complaining that ActionBarDrawerToggle wants MainActivity, DrawerLayout, Int, Int, Int and even though I have seen other Stack questions such as this and this use it the way I am and followed their fixes, I am still getting the same error.

Any ideas?

To add this activity is also using googlemap, not sure if that would make any difference here

Community
  • 1
  • 1
Nick Bull
  • 1,099
  • 10
  • 23
  • You should have it in this order: `mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, X, R.string.drawer_open, R.string.drawer_close)`. Where X is your icon for your drawer; usually your toolbar goes here. – McGuile Jun 19 '15 at 17:08
  • Brilliant thank you!! – Nick Bull Jun 19 '15 at 17:19

1 Answers1

0

Import ActionBarDrawerToggle from v7 supporting library, not v4 support library

import android.support.v7.app.ActionBarDrawerToggle;

remove this

 import android.support.v4.app.ActionBarDrawerToggle;
RajaReddy PolamReddy
  • 22,428
  • 19
  • 115
  • 166