Search code examples
androidandroid-fragmentsandroid-sliding

null pointer when assigning drawer list adapter


I'm trying out to create a slide menu for android using this tutorial then I come up with this error, said that I have null pointer. Here are the corresponding class and logcat output NavDrawerListAdapter class, NavdrawerItem, and logcat. So far I've tried to discover what make it null and double check the tutorial, but I can't figure out any clue. I'll appreciate any help, thank you.


Solution

  • In your Adapter's getView() method, the line:

    if(context == null)
    

    should be:

    if(convertView == null)