Example #1
0
  @Override
  protected void onPause() {

    super.onPause();
    if (deleteEmpty()) {
      ln.updateDate();
      Backend.writeData(this.getApplicationContext()); // backup data
    }
  }
Example #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.listnote_view);

    int noteId = getIntent().getBundleExtra("bundle").getInt("noteId");
    ln = (ListNote) Backend.getNote(noteId);
    getSupportActionBar().setTitle(Html.fromHtml("<b>" + ln.getName() + "</b>"));
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    // obtain list view and create new list custom adapter
    listView = (ListView) findViewById(R.id.listnote_listview);
    listAdapter = new ListNoteAdapter(this, ln);
    listView.setAdapter(listAdapter); // attach adapter to list view

    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
  }