11

I am about two weeks in to Android development, and I'm sure there is a very simple answer to this, but will be needing to create a drawer slider for my application. Unfortunately, I cannot seem to find R.layout.drawer_list for my adapter set-up. I currently have a listView, but want this to be in a sliding drawer. I follow the api guides on developer.android and can't seem to get past this:

mDrawerList.setAdapter(new ArrayAdapter<String>(this,                
        R.layout.drawer_list_item, mPlanetTitles));

Now this is just pasted from developer.android but what it all comes down to is that eclipse can't find R.layout.drawer_list_item. I get no list of options from R.layout, but do receive a list from android.R.layout... unfortunately, that list doesn't contain the drawer_list_item option.

Any help would be greatly appreciated.

Elliott
  • 147
  • 2
  • 11

1 Answers1

16

You'll have to create the R.layout.drawer_list_item layout yourself (it need only be a simple layout with a TextView; the layout is the one that represents one item in your drawer list). Have you downloaded the sample app? You can copy&paste most stuff, get it working and then go from there.

fweigl
  • 21,278
  • 20
  • 114
  • 205
  • Thank you! I should have dl'ed that sample. I thought it was a built in layout like the simple_expandable_list. Saves me a whole lot of trouble. Will accept as answer in a moment. Thanks again – Elliott Jan 27 '14 at 21:38
  • No problem. You can also play a bit with the sample app to see which element / layout does what ;) – fweigl Jan 27 '14 at 21:42