void handleGoogleException(final IOException e) {
if (e instanceof GoogleJsonResponseException) {
GoogleJsonResponseException exception = (GoogleJsonResponseException) e;
if (exception.getStatusCode() == 401 && !received) {
received = true;
accountManager.invalidateAuthToken(authToken); // authentication 에러를 발생하고 실패한다면 캐쉬된
// authtoken이 오래되었거나 더 이상 서버에 의해 인정되지 않음을 의미.
// 어플리케이션은 캐쉬로부터 token을 제거하기 위해 invalidateAuthToken호출
authToken = null;
SharedPreferences.Editor editor2 = settings.edit();
editor2.remove(PREF_AUTH_TOKEN);
editor2.commit();
gotAccount();
}
}
Log.e(TAG, e.getMessage(), e);
runOnUiThread(new Runnable() {
public void run() {
new AlertDialog.Builder(CalendarSample.this).setTitle("Exception")
.setMessage(e.getMessage()).setNeutralButton("ok", null).create().show();
}
});
}
위 메서드에서 if (exception.getStatusCode() == 401 && !received)
이부분이 이해되지 않습니다.
그리고 401이라는 것은 어디서 아는 건가요??