示例#1
0
 @OnClick(R.id.btnSave)
 public void saveClicked(View v) {
   City newCity =
       new City(etCity.getText().toString(), new Date(System.currentTimeMillis()).toString());
   newCity.save();
   refreshList();
 }
示例#2
0
  private void refreshList() {
    List<City> cities = City.listAll(City.class);

    tvData.setText("");
    for (City city : cities) {
      tvData.append(city.getCityName() + ", " + city.getDateAdded() + "\n");
    }
  }
示例#3
0
 @OnClick(R.id.btnDeleteAll)
 public void deleteAll(View v) {
   City.deleteAll(City.class);
   refreshList();
 }