This is a really great article. Thank you very much for writing it. It may be helpful to consider the following change
executor.execute(() -> {
if (response != null) {
User user = response.body();
if (user != null) {
user.setLastRefresh(new Date());
userDao.save(user);
}
}
});
If the USER_LOGIN
on line 22 of the MainActivity is changed to an unrecognized username, the app will crash on an NPE.
Obviously, you put a lot of time and effort into the code and this article. Thank you very much for your hard work.