0
我在由活動託管的片段內創建DialogFragment。下面是如何創建的對話框:第二次輪換時出現DialogFragment崩潰(IllegalStateException)
NewDialogEditText ageDialog = new NewDialogEditText.Builder()
.setCharLimit(2)
.setInputType(TYPE_CLASS_NUMBER)
.setTitle(R.string.dialog_title_age)
.createDialog();
ageDialog.setTargetFragment(WeightPlanFragment.this, REQUEST_AGE);
ageDialog.show(getFragmentManager(), DIALOG_AGE);
在設備進行重新配置(在這種情況下旋轉)與輸入(膨脹與dialogfragment類內一個EditText的佈局沿保持對話然而,在另一種重新配置,我收到崩潰:
Failure saving state: NewDialogEditText{5c12148 #0 dialog_age} has target not in fragment manager