Ejemplo n.º 1
0
 private void loadFromObj(DbObj obj) {
   mFeedUri = obj.getContainingFeed().getUri();
   mType = obj.getType();
   mObj = obj;
   mJson = obj.getJson();
   mRaw = obj.getRaw();
   mHash = obj.getHash();
   mContactId = obj.getSender().getLocalId();
 }
Ejemplo n.º 2
0
 @Override
 public void onAct(Context context, DbEntryHandler objType, DbObj obj) {
   DBHelper dbh = DBHelper.getGlobal(context);
   try {
     // TODO: do with content provider... this method ignore the
     // feed uri for now
     long hash = obj.getHash();
     Uri feedUri = obj.getContainingFeed().getUri();
     if (hash == 0) {
       Toast.makeText(context, "Message not yet sent.", Toast.LENGTH_SHORT).show();
       return;
     }
     Helpers.sendToFeeds(context, DeleteObj.TYPE, DeleteObj.json(hash), new Uri[] {feedUri});
     dbh.deleteObjByHash(feedUri, hash);
   } finally {
     dbh.close();
   }
 }