java - How to avoid calling the method at the same time in main thread? -
i have recyclerview , there method sending request every 10 seconds,than calls method update recyclerview list,but there 1 case manually when change example user details , request sent , method called again update list,i want 1 call of method updates recyclerview adapter finished,than second 1 start.
i think can use scary wombat answer, use:
public void synchronized method() { ... }
a method can called @ exact same time if , if there more 1 thread invoking it.
in scenario, main thread , child thread invoking it.
Comments
Post a Comment