Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve symbol DrawerLayout

I'm trying to implement the Navigation Drawer as shown here: http://developer.android.com/training/implementing-navigation/nav-drawer.html#top

My code seems to be ok, and My minimum and target levels in my manifest match the example, but it's telling me it can't find the following three references

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

enter image description here

enter image description here

like image 647
Jhorra Avatar asked Jun 07 '13 21:06

Jhorra


People also ask

What is DrawerLayout?

DrawerLayout acts as a top-level container for window content that allows for interactive "drawer" views to be pulled out from one or both vertical edges of the window.


2 Answers

May be you have found your answer but i think its for those who still wants to know. so, here's my answer,

For Android Studio:

First of all you need to add External Jar

  • In android studio go to File-> Project Structure -> Modules -> Dependencies -> + symbol -> Library Dependency.
  • Now search for support library. you will find something like this com.android.support:support-v13
  • Now, select Jar file named support-v13 (Whatever the version is) and click OK.

Now, you will see, no more errors like this.

For Eclipse:

Refer this link, Click here

like image 84
Jaydipsinh Zala Avatar answered Sep 20 '22 20:09

Jaydipsinh Zala


You need to make sure you are using the latest support library as the DrawerLayout and other items were added in the May 2013 release.

  • Added DrawerLayout for creating a Navigation Drawer that can be
    pulled in from the edge of a window.

like image 45
Aaron McIver Avatar answered Sep 21 '22 20:09

Aaron McIver