Merge pull request #1176 from hismaeel/1119

Fixed Hard Coded Column issue. #1119
This commit is contained in:
neslihanturan 2018-03-16 11:09:47 +02:00 committed by GitHub
commit eaba96b509
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 23 deletions

View file

@ -54,12 +54,12 @@ public class ModifierSequenceDao {
// Hardcoding column positions!
ModifierSequence ms;
try {
ms = new ModifierSequence(Uri.parse(cursor.getString(1)),
new JSONObject(cursor.getString(2)));
ms = new ModifierSequence(Uri.parse(cursor.getString(cursor.getColumnIndex(Table.COLUMN_MEDIA_URI))),
new JSONObject(cursor.getString(cursor.getColumnIndex(Table.COLUMN_DATA))));
} catch (JSONException e) {
throw new RuntimeException(e);
}
ms.setContentUri( ModificationsContentProvider.uriForId(cursor.getInt(0)));
ms.setContentUri( ModificationsContentProvider.uriForId(cursor.getInt(cursor.getColumnIndex(Table.COLUMN_ID))));
return ms;
}