DEV Community

Abdulrahman salama
Abdulrahman salama

Posted on

Refreshing data in RecyclerView and keeping its scroll position take user to the top of the activity

I'm trying to implement app like Instagram where user can like and share but when he press on a button (like image heart) .

///interface to get position
@Override
public void onitemclick(int position) {
 position_of_image=position;
int num1=uploads.get(position_of_image).getNumber_likes();
uploads.get(position_of_image).setNumber_likes(num1+1);

String id=uploads.get(position_of_image).getId();
int number= uploads.get(position_of_image).getNumber_likes();
String name= uploads.get(position_of_image).getName();
String url=uploads.get(position_of_image).getImageUrl();

//updating the








https://stackoverflow.com/q/61070883/10447139

Anyone Know the solution??

Top comments (0)