Application closing alone after Holder.textViewVar.setVisibility

Asked

Viewed 43 times

0

I have a RecyclerView and in each item I would like to check if a fact occurred to show or not a button:

@Override
public void onBindViewHolder(ViewHolder holder, int position) {

    Posts post = Posts.get(position);
    holder.post = post;

    //Loading image from url
    imageLoader = CustomVolleyRequest.getInstance(context).getImageLoader();

    //parte nova que trava (essas 7 linhas):
    String lk = post.getLk();
    if (lk.equals("1")) { //show button
        holder.textViewUnlk.setVisibility(View.VISIBLE);
    } else { //hide
        holder.textViewLk.setVisibility(View.VISIBLE);
    }



    holder.textViewName.setText(post.getName());

    holder.textViewPublisher.setText(post.getPublisher());
    holder.setIsRecyclable(false);
}

The textViewLk and the textViewUnlk are in XML as GONE. What can it be?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.