Android 不按按钮关闭AlertDialog
我想通过套接字与服务器建立连接,当手机尝试建立连接时,我想打开一个AlertDialog(警报对话框),但不带在建立连接时关闭的按钮Android 不按按钮关闭AlertDialog,android,android-alertdialog,Android,Android Alertdialog,我想通过套接字与服务器建立连接,当手机尝试建立连接时,我想打开一个AlertDialog(警报对话框),但不带在建立连接时关闭的按钮 private void attempToSendXML(AlertDialog.Builder builder, String profile) { SocketClient client = new SocketClient(); Alerts.establishConnection(builder); connectionEstabl
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;
}
您可能需要阅读手册中有关流程对话框的部分。它们也是警报对话框
AlertDialog.Builder返回具有.close()函数的对象。用它来关闭对话框。要正确删除
对话框,您应该调用