use of com.ushahidi.android.app.entities.MediaEntity in project Ushahidi_Android by ushahidi.
the class MediaDao method addMedia.
/*
* (non-Javadoc)
*
* @see com.ushahidi.android.app.database.IMediaDao#addMedia(java.util.List)
*/
@Override
public boolean addMedia(List<MediaEntity> sMedia) {
try {
mDb.beginTransaction();
for (MediaEntity media : sMedia) {
addMedia(media);
}
mDb.setTransactionSuccessful();
} finally {
mDb.endTransaction();
}
return true;
}
use of com.ushahidi.android.app.entities.MediaEntity in project Ushahidi_Android by ushahidi.
the class MediaDao method fetchCheckinPhoto.
@Override
public List<MediaEntity> fetchCheckinPhoto(int checkinId) {
listMedia = new ArrayList<MediaEntity>();
final String[] selectionArgs = { String.valueOf(checkinId), String.valueOf(IMAGE) };
final String selection = CHECKIN_ID + " =? AND " + TYPE + " =?";
cursor = super.query(TABLE, MEDIA_COLUMNS, selection, selectionArgs, null);
if (cursor != null) {
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
MediaEntity media = cursorToEntity(cursor);
listMedia.add(media);
cursor.moveToNext();
}
cursor.close();
}
return listMedia;
}
Aggregations