From 6ee539eb52dc213b001e2fff9cd54d2fe8152f4c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 20 Feb 2016 20:18:52 +0100 Subject: [PATCH] rename layout photo_item to directory_item --- .../java/gallery/simplemobiletools/com/DirectoryAdapter.java | 2 +- .../main/java/gallery/simplemobiletools/com/MainActivity.java | 3 ++- app/src/main/res/layout/{photo_item.xml => directory_item.xml} | 0 3 files changed, 3 insertions(+), 2 deletions(-) rename app/src/main/res/layout/{photo_item.xml => directory_item.xml} (100%) diff --git a/app/src/main/java/gallery/simplemobiletools/com/DirectoryAdapter.java b/app/src/main/java/gallery/simplemobiletools/com/DirectoryAdapter.java index 9f241f94e..fa2c32ef6 100644 --- a/app/src/main/java/gallery/simplemobiletools/com/DirectoryAdapter.java +++ b/app/src/main/java/gallery/simplemobiletools/com/DirectoryAdapter.java @@ -27,7 +27,7 @@ public class DirectoryAdapter extends BaseAdapter { public View getView(int position, View view, ViewGroup parent) { ViewHolder holder; if (view == null) { - view = inflater.inflate(R.layout.photo_item, parent, false); + view = inflater.inflate(R.layout.directory_item, parent, false); holder = new ViewHolder(view); view.setTag(holder); } else { diff --git a/app/src/main/java/gallery/simplemobiletools/com/MainActivity.java b/app/src/main/java/gallery/simplemobiletools/com/MainActivity.java index 6690bfc83..1bfc1ceac 100644 --- a/app/src/main/java/gallery/simplemobiletools/com/MainActivity.java +++ b/app/src/main/java/gallery/simplemobiletools/com/MainActivity.java @@ -35,7 +35,8 @@ public class MainActivity extends AppCompatActivity implements OnItemClickListen private Map getDirectories() { final Map directories = new TreeMap<>(); final Uri uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; - final Cursor cursor = getContentResolver().query(uri, null, null, null, null); + final String[] columns = {MediaStore.Images.Media.DATA}; + final Cursor cursor = getContentResolver().query(uri, columns, null, null, null); if (cursor != null && cursor.moveToFirst()) { final int pathIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATA); diff --git a/app/src/main/res/layout/photo_item.xml b/app/src/main/res/layout/directory_item.xml similarity index 100% rename from app/src/main/res/layout/photo_item.xml rename to app/src/main/res/layout/directory_item.xml