IllegalStateException( “You can not set Dialog's OnCancelListener or OnDismissListener”)
问题 This DialogFragment implementation causes an IllegalStateException( "You can not set Dialog's OnCancelListener or OnDismissListener") . Why? Solution? public class OkCThreadDialog1 extends DialogFragment{ DialogInterface.OnCancelListener onCancelListener; public OkCThreadDialog1(){ } public static OkCThreadDialog1 newInstance(String title, String message) { OkCThreadDialog1 frag = new OkCThreadDialog1(); Bundle args = new Bundle(); args.putString("title", title); args.putString("message",