rename layout photo_item to directory_item

This commit is contained in:
tibbi 2016-02-20 20:18:52 +01:00
parent d285b3e261
commit 6ee539eb52
3 changed files with 3 additions and 2 deletions

View File

@ -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 {

View File

@ -35,7 +35,8 @@ public class MainActivity extends AppCompatActivity implements OnItemClickListen
private Map<String, Directory> getDirectories() {
final Map<String, Directory> 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);