Ejemplo n.º 1
0
 public void revert() {
   boolean delSuccess = adapter.deleteTargets(id.value);
   for (Target orig : original) {
     // FIX 24/01/12 Probably make the order of these arguments consistent.
     adapter.create(id.value, orig.number, orig.name);
   }
 }
Ejemplo n.º 2
0
 public void refresh() {
   final SimpleCursorAdapter.ViewBinder view = new DefaultTargetViewBinder(adapter);
   final Cursor cursor = adapter.fetchByRiposteId(id.value);
   final ListView listView = activity.getListView();
   final ComponentIndex rowIndex = new ComponentIndex(R.layout.target_row);
   final TargetListMapping mapping = new TargetListMapping();
   lists.refresh(activity, cursor, listView, rowIndex, mapping, view);
 }
Ejemplo n.º 3
0
 public void delete(final TargetId tid) {
   adapter.deleteById(tid.value);
   refresh();
 }
Ejemplo n.º 4
0
 public void update(final BasicContact contact) {
   boolean isDuplicate = adapter.contains(id.value, contact.number);
   if (!isDuplicate) {
     adapter.create(id.value, contact.number, contact.name);
   }
 }
Ejemplo n.º 5
0
 public DefaultTargets(final ListActivity activity, final SQLiteDatabase db, final RiposteId id) {
   this.activity = activity;
   adapter = new DefaultTargetDbAdapter(db);
   this.id = id;
   original = adapter.getTargets(id.value);
 }