I currently have a DialogFragment that has a couple of EditText widgets as part of this view. When a change in orientation occurs, the EditText widgets are not populated by the text that was in them.
I looked at the saveInstanceState file and the text is saved, although the orientation is changed.
DialogFragment:
public final class LoginDialog extends DialogFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.login, container, false); return v; } }
EditText example:
<EditText android:text="" android:id="@+id/loginUsername" android:layout_width="180dip" android:layout_height="wrap_content" android:layout_marginRight="5dip"/>
I am using an Android compatibility pack.
source share