public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); Log.i(TAG, "onSaveInstanceState()"); if (mTicket != null) { outState.putString("mTitle", mTicket.getTitle()); outState.putString("mLogin", mTicket.getLogin()); outState.putString("mPassword", mTicket.getPassword()); outState.putString("mNotes", mTicket.getNotes()); } outState.putInt("mId", id); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.i(TAG, "onCreate()"); mDbHelper = new DBHelper(getActivity()); if (savedInstanceState != null) { mTicket = new Ticket(); mTicket.setTitle(savedInstanceState.getString("mTitle")); mTicket.setLogin(savedInstanceState.getString("mLogin")); mTicket.setPassword(savedInstanceState.getString("mPassword")); mTicket.setNotes(savedInstanceState.getString("mNotes")); id = savedInstanceState.getInt("mId"); } }
private void initUI() { Log.i(TAG, "initUI()"); mTitle = (TextView) getView().findViewById(R.id.tv_title); mLogin = (TextView) getView().findViewById(R.id.tv_login_data); mPassword = (TextView) getView().findViewById(R.id.tv_password_data); mNotes = (TextView) getView().findViewById(R.id.tv_notes_data); if (mTicket != null) { mTitle.setText(mTicket.getTitle()); mLogin.setText(mTicket.getLogin()); mPassword.setText(mTicket.getPassword()); mNotes.setText(mTicket.getNotes()); } }
public ItemsDescription(Ticket ticket) { if (ticket == null) { throw new IllegalArgumentException(); } this.mTicket = ticket; id = ticket.getId(); }
public Ticket createTicket() { Ticket mTicket = new Ticket(); mTicket.setTitle((mTitle.getText()).toString().trim()); mTicket.setLogin((mLogin.getText()).toString().trim()); mTicket.setPassword((mPassword.getText()).toString().trim()); mTicket.setNotes((mNotes.getText()).toString().trim()); mTicket.setId(id); return mTicket; }
private void showAlertDialog() { new MyCustomAlertDialog(mTicket.getId()).show(getFragmentManager(), "tag"); }