@Override public void onErrorResponse(VolleyError error) { doingLogin = false; SharedPreferences sp = PrefUtil.getPref(context, MYPREFS); PrefUtil.remove(sp, KEY_USERKEY); if (onCompleteLoginListener != null) onCompleteLoginListener.onCompleteLogin(false); }
@Override public void onResponse(ResponseLogin response) { doingLogin = false; if (response.getIs_success() == 1) { login(); userKey = response.getUkey(); saveUserKeyToSharedPreference(); } else { logout(); SharedPreferences sp = PrefUtil.getPref(context, MYPREFS); PrefUtil.remove(sp, KEY_USERKEY); } if (onCompleteLoginListener != null) onCompleteLoginListener.onCompleteLogin(response.getIs_success() == 1); }