我在 Asynctask 中有 onPostExecute
protected void onPostExecute(Void unused) {
TextView tvStatus=(TextView) layoutSendDialog.findViewById(R.id.tvPupukSendStatus);
if (bNodata){
tvStatus.setText("No data to be sent!!!");
}else {
if (bError){
tvStatus.setText("Fail at record #"+String.format("%d",recordCount));
}
else {
tvStatus.setText("Sending Data : Finished");
CUtilities.showAlert(CInputHamaApp.this, "Data Terkirim");
createDialogSend2();
// Closing dashboard screen
}
}
// dismissDialog(CGeneral.DIALOG_SEND);
}
这是我的对话
private Dialog createDialogSend2(){
AlertDialog.Builder builder = new AlertDialog.Builder(CInputHamaApp.this);
builder.setMessage("Anda yakin untuk update?");
builder.setTitle("Warning") ;
builder.setPositiveButton("YES", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dlg, int sumthin) {
Intent i2 = new Intent(CInputHamaApp.this, CInputHamaApp.class);
startActivity(i2);
}
});
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dlg, int sumthin) {
// do nothing – it will close on its own
}
});
return builder.create();
}//createDialogSend2
我把createDialogSend2();
这个 onPostExecute 代码
else {
tvStatus.setText("Sending Data : Finished");
CUtilities.showAlert(CInputHamaApp.this, "Data Terkirim");
createDialogSend2();
// Closing dashboard screen
}
但结果是当状态完成时,对话框仅显示警报,而createDialogSend2();
不是运行。
如何createDialogSend2()
在文本发送数据完成时显示
BR
亚历克斯