我想通过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;
}