Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 @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");
   }
 }
Ejemplo n.º 3
0
  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());
    }
  }
Ejemplo n.º 4
0
  public ItemsDescription(Ticket ticket) {
    if (ticket == null) {
      throw new IllegalArgumentException();
    }

    this.mTicket = ticket;
    id = ticket.getId();
  }
Ejemplo n.º 5
0
  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;
  }
Ejemplo n.º 6
0
 private void showAlertDialog() {
   new MyCustomAlertDialog(mTicket.getId()).show(getFragmentManager(), "tag");
 }