📅  最后修改于: 2022-03-11 14:52:18.644000             🧑  作者: Mango
OnClickListener onClickListener = new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(action));
}
};
Button button = (Button) findViewById(id);
button.setOnClickListener(onClickListener);