我想通過Socket建立與服務器的連接,而手機正試圖建立連接時,我想在沒有連接時關閉的按鈕的情況下調出AlertDialog成立。在不按下按鈕的情況下關閉AlertDialog
private void attempToSendXML(AlertDialog.Builder builder, String profile) {
SocketClient client = new SocketClient();
Alerts.establishConnection(builder);
connectionEstablished = client.createClient(server, port);
//Close the Dialog here!
if (!connectionEstablished) {
connectionRefusedAlert(builder);
return;
}