diff --git a/app/src/main/java/com/example/nemophila/viewmodels/AccountViewModel.java b/app/src/main/java/com/example/nemophila/viewmodels/AccountViewModel.java index cc86a83..69ba464 100644 --- a/app/src/main/java/com/example/nemophila/viewmodels/AccountViewModel.java +++ b/app/src/main/java/com/example/nemophila/viewmodels/AccountViewModel.java @@ -15,6 +15,7 @@ // フィールド private final Retrofit retrofit; private final AccountsRest accountsRest; + private Account account; // コンストラクタ public AccountViewModel() { @@ -23,6 +24,7 @@ .addConverterFactory(JacksonConverterFactory.create()) .build(); this.accountsRest = retrofit.create(AccountsRest.class); + this.account = new Account(); } // アカウント情報の取得 @@ -32,6 +34,11 @@ call.enqueue(new Callback() { @Override public void onResponse(Call call, Response response) { + if (response.isSuccessful()) { + account = response.body(); + } else { + // エラー + } } @Override public void onFailure(Call call, Throwable t) {