Пример #1
0
 @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);
 }
Пример #2
0
        @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);
        }