什么时候
我期待onDismiss(或onCancel)会被召唤.但是,它们都没有被调用.我可以知道有什么我想念的吗?从AlertDialog setOnDismissListener不起作用,我以为onCancel当我按下后退按钮时会调用它.但它对我不起作用.我可以知道有什么我错过了吗?
public class RateAppDialogFragment extends SherlockDialogFragment {
public static RateAppDialogFragment newInstance() {
RateAppDialogFragment rateAppDialogFragment = new RateAppDialogFragment();
return rateAppDialogFragment;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Get the layout inflater
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.rate_app_dialog_fragment, null);
Utils.setCustomTypeFace(view, Utils.ROBOTO_LIGHT_TYPE_FACE);
final AlertDialog dialog = new AlertDialog.Builder(this.getSherlockActivity())
.setTitle("Love JStock?")
.setView(view)
// Add action buttons
.setPositiveButton("Rate 5 stars \u2605", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int …Run Code Online (Sandbox Code Playgroud) android ×1