Closed andreabellitto closed 9 years ago
StyledDialogs have different architecture of listeners which survive rotation. You can listen to them in Activity or Fragment. ProgressDialog already has a support for OnCancelListener. Look into DemoActivity how it's used.
As in title i need to add an OnCancelListener on a ProgressDialogFragment, what i want to do is something like this:
ProgressDialogFragment.createBuilder(this, getSupportFragmentManager()) .setTitle(appContext.getString(R.string.progressDialogTitle)) .setMessage(appContext.getString(R.string.progressDialogMessage)) .setOnCancelListener(myOnCancelListener) .show(); This will enable me to show a fragment from inside an asynktask and listen there for his cancellation.