Use/check recycler view adapter position

This commit is contained in:
M66B
2018-08-05 18:36:39 +00:00
parent b1cc40bb47
commit 959bfdf9df
5 changed files with 24 additions and 6 deletions

View File

@@ -82,7 +82,10 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
@Override
public void onClick(View view) {
final TupleAttachment attachment = filtered.get(getLayoutPosition());
int pos = getAdapterPosition();
if (pos == RecyclerView.NO_POSITION)
return;
final TupleAttachment attachment = filtered.get(pos);
if (attachment != null)
if (attachment.content) {
// Build file name