I have written a functionality where onClick
of CardView
item in Recyclerview
, it starts an intent and goes to another activity. It works fine but the problem is the RecyclerView flickers/ Blinks for a short period, which I find it odd.
I tried multiple solutions and none worked.
I have attached one solution I tried but it did not work for me. By the way, I dont use notifyDataSetChanged()
as I dont need it in my case.
RecyclerView blinking after notifyDatasetChanged()
holder.listitemCard.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final Model gridItem = someList.get(position);
setCurrentSomething(gridItem);
Intent intent = new Intent(view.getContext(), SomeClass.class);
view.getContext().startActivity(intent);
}
});