i creating dialogfragment within fragment hosted activity. here's how create dialog:
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);
upon device reconfig (rotate in case) dialog maintained along input (inflating layout edittext within dialogfragment class. however, upon reconfig, receive crash:
failure saving state: newdialogedittext{5c12148 #0 dialog_age} has target not in fragment manager
try this
<activity android:name=".mainactivity" android:configchanges="orientation|keyboardhidden|screensize" android:label="@string/app_name" android:theme="@style/apptheme.noactionbar" />
Comments
Post a Comment