按钮事件空指针错误

按钮事件空指针异常
做个软件的登入注册界面,可是刚开始的一个登录就出现问题了,代码如下
public class Login extends Activity {
Button login, register, out;
private static EditText username, password;
Intent intent = null;
private ButtonListener listener = new ButtonListener();

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.down);

login = (Button) findViewById(R.id.btn_Login);
register = (Button) findViewById(R.id.btn_Reset);
out = (Button) findViewById(R.id.btn_Out);

username = (EditText) findViewById(R.id.et_staff_no);
password = (EditText) findViewById(R.id.et_password);

login.setOnClickListener(listener);
register.setOnClickListener(listener);
out.setOnClickListener(listener);

}

private final class ButtonListener implements OnClickListener {

@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_Login:
Toast.makeText(Login.this, "登录了", 1).show();
intent = new Intent(Login.this, Down.class);
startActivity(intent);
break;
case R.id.btn_Reset:
Toast.makeText(Login.this, "注册了", 1).show();
break;
case R.id.btn_Out:
Toast.makeText(Login.this, "退出了", 1).show();
break;
}
}

}

我看了半天不知道哪里有问题,LOGCAT报错是login = (Button) findViewById(R.id.btn_Login);
register = (Button) findViewById(R.id.btn_Reset);
out = (Button) findViewById(R.id.btn_Out);
为空,可是我之前也写过这样的方法的,可以编译,但是现在怎么就不行了,实在找不出问题了,特来求教
android  空指针异常

------解决方案--------------------
肯定是佈局文件出錯了,你確定註冊界面的佈局文件是down.xml文件嗎?
------解决方案--------------------
按钮事件空指针错误认真查阅xml文件中的id,是否一样
------解决方案--------------------