Skip to content

Commit

Permalink
Close the database cursor in MediaUtils
Browse files Browse the repository at this point in the history
Now the cursor is closed in the getLastRecordedVideoUri() method.
  • Loading branch information
andrew659 committed Oct 9, 2016
1 parent 8e436bd commit a528b64
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ public static Uri getLastRecordedVideoUri(Activity activity) {
CursorLoader loader = new CursorLoader(activity, contentUri, proj, null, null, sortOrder);
Cursor cursor = loader.loadInBackground();
cursor.moveToFirst();
long value = cursor.getLong(0);
cursor.close();

return Uri.parse(contentUri.toString() + "/" + cursor.getLong(0));
return Uri.parse(contentUri.toString() + "/" + value);
}

/**
Expand Down

0 comments on commit a528b64

Please sign in to comment.