Search code examples
androidactionbarsherlock

DrawerLayout and ActionBarDrawerToggle cannot be resolved to a type


I am trying to implement ActionBarSherlock Side Menu Navigation Drawer in my app, but always getting :

DrawerLayout cannot be resolved to a type ActionBarDrawerToggle cannot be resolved to a type

My imports are:

import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.MenuItem;

Solution

  • Import these from the support library

    import android.support.v4.app.ActionBarDrawerToggle;
    import android.support.v4.widget.DrawerLayout;
    

    Check this

    http://developer.android.com/tools/support-library/index.html

    For more info on NaigationDrawer

    http://developer.android.com/training/implementing-navigation/nav-drawer.html