btn_login没有初始化,在注册监听之前,先对btn_login进行初始化,即在setContentView( ..)函数后面加一句 btn_login=findViewById(id);函数参数是控件的id值,比如我的id为 btn_login,则参数为R.id.btn_login