|
public void resetState() { |
In your method calls especially when you are changing data, it is good practice to annotate your methods with the expected thread they will be called from i.e. UiThread or AnyThread. Thinking about threading will help you avoid tricky race condition problems in the future for example here you could potentially run into unexpected consequences if this reset method is called while the user is scrolling as both could be touching the isLoading boolean. If you know both methods are on the same UI thread then such a race condition in theory isn't possible.
Twitter/app/src/main/java/com/codepath/apps/restclienttemplate/EndlessRecyclerViewScrollListener.java
Line 96 in f7bcb1e
In your method calls especially when you are changing data, it is good practice to annotate your methods with the expected thread they will be called from i.e. UiThread or AnyThread. Thinking about threading will help you avoid tricky race condition problems in the future for example here you could potentially run into unexpected consequences if this reset method is called while the user is scrolling as both could be touching the isLoading boolean. If you know both methods are on the same UI thread then such a race condition in theory isn't possible.