Set ID on EditText so it automatically saves state on rotation
This commit is contained in:
parent
dc8b244369
commit
41a36bbe70
@ -48,6 +48,8 @@ public class AddLabelDialog extends AppCompatDialogFragment {
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
mEditText = new EditText(getActivity());
|
||||
// Views must have IDs set to automatically save instance state
|
||||
mEditText.setId(R.id.label);
|
||||
mEditText.setText(mInitialText);
|
||||
mEditText.setInputType(
|
||||
EditorInfo.TYPE_CLASS_TEXT // Needed or else we won't get automatic spacing between words
|
||||
|
||||
Loading…
Reference in New Issue
Block a user