Fixed bug causing wrong time to show

TYPE SAFETY FOR THE FUCKING WIN FUCK YEAH
This commit is contained in:
YuviPanda 2012-11-10 18:32:08 +05:30
parent efecef0a6c
commit 634f236f19

View file

@ -118,11 +118,12 @@ public class UploadService extends IntentService {
try { try {
file = this.getContentResolver().openInputStream(mediaUri); file = this.getContentResolver().openInputStream(mediaUri);
length = this.getContentResolver().openAssetFileDescriptor(mediaUri, "r").getLength(); length = this.getContentResolver().openAssetFileDescriptor(mediaUri, "r").getLength();
Cursor cursor = this.getContentResolver().query(mediaUri, Cursor cursor = this.getContentResolver().query(mediaUri,
new String[] { MediaStore.Images.ImageColumns.DATE_TAKEN }, null, null, null); new String[] { MediaStore.Images.ImageColumns.DATE_TAKEN }, null, null, null);
if(cursor.getCount() != 0) { if(cursor.getCount() != 0) {
cursor.moveToFirst(); cursor.moveToFirst();
dateCreated = new Date(cursor.getInt(0)); dateCreated = new Date(cursor.getLong(0));
} }
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
throw new RuntimeException(e); throw new RuntimeException(e);