SimonVT / android-menudrawer

*DEPRECATED* A slide-out menu implementation, which allows users to navigate between views in your app.
http://simonvt.github.com/android-menudrawer/
Apache License 2.0
2.59k stars 1.11k forks source link

Strange NullPonterException #224

Closed MasterGroosha closed 10 years ago

MasterGroosha commented 10 years ago

Hello. I'm getting NPE here:

mDrawer.setTouchMode(MenuDrawer.TOUCH_MODE_FULLSCREEN);

That's all I've got for now:

import net.simonvt.menudrawer.MenuDrawer;
import android.app.Activity;
import android.os.Bundle;

public class Person_FeedList extends Activity{

    private MenuDrawer mDrawer;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.userfeed);  
        mDrawer = (MenuDrawer) findViewById(R.id.drawer);
        mDrawer.setTouchMode(MenuDrawer.TOUCH_MODE_FULLSCREEN); 
    }
}

By the way, R.layout.drawer exists

SimonVT commented 10 years ago

Either the drawer doesn't exist in R.layout.userfeed, or id's are messed up by your build system.