I have activity A which have a ListView with custom adapter.
The custom adapter (which aplies to each list view item) have a button which invokes a custom dialog.
in this dialog an action is being performed which in response i want to invoke UI update on activity A.
This is my activity on resume code:
@Override
public void onResume()
{
super.onResume();
setUI();
}
But when the i call
dialog.dismiss();
The dialog closes without the Activity A OnResume method benig invoked.
How can i catch and update the activity ui?
You can set an OnDismissListener to your dialog to achieve this:
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setOnDismissListener(listener);
...
Dialog dialog = builder.create();
You can let your Activity impelement DialogInterface.OnDismissListener and set them as the listener, so they get notified in the method onDismiss(DialogInterface dialog). In there, you can update your UI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With