btnPhotoGalary = (Button) findViewById(R.id.btn_photo_galary);
btnPhotoGalary.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(SplashActivity.this,
AllPhotoActivity.class));
}
});
btnInformation = (Button) findViewById(R.id.btn_information);
btnInformation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(SplashActivity.this,
Information.class));
}
});
此代码用于按钮的单击事件。信息按钮显示在应用程序中,但是当您单击它时,应用程序会自动关闭。为什么?