Dar*_*pan 3 android android-dialog
我用 - 创建了一个简单的对话框 -
Dialog dialog = new Dialog(Myactivity.this);
dialog.setContentView(R.layout.myLayout);
dialog.show();
Run Code Online (Sandbox Code Playgroud)
当我显示和关闭此对话框时,我想更新textView MyActivity.因此,onResume()当你解雇时,我会假设它被调用dialog.这是真的吗?或者我们还有其他更新方法textView吗?
您可以更新TextView实现 OnDismissListener接口:
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
//update your textView
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2792 次 |
| 最近记录: |