setListAdapter(secretsList);
getListView().setTextFilterEnabled(true);
// Setup the auto complete adapters for the username and email views.
AutoCompleteTextView username = (AutoCompleteTextView)
findViewById(R.id.list_username);
AutoCompleteTextView email = (AutoCompleteTextView)
findViewById(R.id.list_email);
username.setAdapter(secretsList.getUsernameAutoCompleteAdapter());
email.setAdapter(secretsList.getEmailAutoCompleteAdapter());
// The 3d flip animation will be done on the root view of this activity.
// Also get the edit group of views for use as the second view in the
// animation.
root = findViewById(R.id.list_container);
edit = findViewById(R.id.edit_layout);
// When the SEARCH key is pressed, make sure the global search dialog
// is displayed.
setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
// If there is state information, use it to initialize the activity.
if (null != state) {
isEditing = state.getBoolean(STATE_IS_EDITING);
if (isEditing) {
EditText description = (EditText) findViewById(R.id.list_description);
EditText password = (EditText) findViewById(R.id.list_password);
EditText notes = (EditText) findViewById(R.id.list_notes);
editingPosition = state.getInt(STATE_EDITING_POSITION);
description.setText(state.getCharSequence(STATE_EDITING_DESCRIPTION));
username.setText(state.getCharSequence(STATE_EDITING_USERNAME));
password.setText(state.getCharSequence(STATE_EDITING_PASSWORD));
email.setText(state.getCharSequence(STATE_EDITING_EMAIL));
notes.setText(state.getCharSequence(STATE_EDITING_NOTES));
getListView().setVisibility(View.GONE);
edit.setVisibility(View.VISIBLE);
}