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(); }
@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(); } }