mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-18 06:17:59 +01:00
small tweak to viewpager cursor
This commit is contained in:
parent
6248f0db76
commit
5beadedfe2
1 changed files with 2 additions and 4 deletions
|
@ -73,10 +73,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
try {
|
try {
|
||||||
val proj = arrayOf(MediaStore.Images.Media.DATA)
|
val proj = arrayOf(MediaStore.Images.Media.DATA)
|
||||||
cursor = contentResolver.query(uri, proj, null, null, null)
|
cursor = contentResolver.query(uri, proj, null, null, null)
|
||||||
if (cursor != null) {
|
if (cursor?.moveToFirst() == true) {
|
||||||
val dataIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA)
|
mPath = cursor.getStringValue(MediaStore.Images.Media.DATA)
|
||||||
cursor.moveToFirst()
|
|
||||||
mPath = cursor.getString(dataIndex)
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
cursor?.close()
|
cursor?.close()
|
||||||
|
|
Loading…
Reference in a new issue