KeenenCharles / AndroidUnplash

An unofficial Unsplash API library for Android
MIT License
85 stars 22 forks source link

get wrong photoID if item clicked #22

Closed muhammadfaisalr closed 4 years ago

muhammadfaisalr commented 4 years ago

here is my code in adapter

  holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                context.startActivity(new Intent(context, DetailPhotoActivity.class).putExtra("photo",photo.getId()));
            }
        });

but photo.getPhotoId(); always return wrong value?

muhammadfaisalr commented 4 years ago

ok issue closed, just use photos.get(position).getId() instead of photo.getId()