small tweak to viewpager cursor
This commit is contained in:
parent
6248f0db76
commit
5beadedfe2
|
@ -73,10 +73,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
|||
try {
|
||||
val proj = arrayOf(MediaStore.Images.Media.DATA)
|
||||
cursor = contentResolver.query(uri, proj, null, null, null)
|
||||
if (cursor != null) {
|
||||
val dataIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA)
|
||||
cursor.moveToFirst()
|
||||
mPath = cursor.getString(dataIndex)
|
||||
if (cursor?.moveToFirst() == true) {
|
||||
mPath = cursor.getStringValue(MediaStore.Images.Media.DATA)
|
||||
}
|
||||
} finally {
|
||||
cursor?.close()
|
||||
|
|
Loading…
Reference in New Issue