Ok I solved it by implementing an onShowListener
on my progressDialog
slotViewHolder.layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setMessage("showing dialog...");
progressDialog.setOnShowListener(new OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
loadDialogAndDoSomeAction();
}
progressDialog.show();
});
I'm dismissing the ProgressDialog
in Alertdialog.onShow()
in loadDialogAndDoSomeAction()