我在警告對話框中有2個按鈕,我想使它一樣,如果「退出」點擊後,會跳轉到MainActivity,當「Restrat」點擊它會跳到B_Activity 感謝警告對話框跳轉到其他活動
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE,"Exit", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE, "Restart", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}