androidandroid-support-libraryactionbardrawertoggle

The import android.support.v7.app.ActionBarDrawerToggle cannot be resolved


I am trying to use the ActionBarDrawerToggle and getting the error:

The import android.support.v7.app.ActionBarDrawerToggle cannot be resolved

It got no problem importing the v4 type but as I understand, it is deprecated and doesn't function as I want to. Further more, I got no issue with importing other v7 classes like ActionBar or ActionBarActivity and it happens with the ActionBarDrawerToggle only.

How can this issue (and type) be resolved?


Solution

  • Some simple steps you need to follow:

    1. Go to your project in the navigator, right click on properties.
    2. Go to the Java Build Path tab on the left.
    3. Go to the libraries tab on top.
    4. Click add external jars.
    5. Go to your ADT Bundle folder, go to sdk/extras/android/support/v7/appcompat/libs.
    6. Select the file android-support-v7-appcompat.jar
    7. Go to order and export and check the box next to your new jar.
    8. Click ok.