diff --git a/app/src/main/java/org/ntlab/acanthus_client/Acanthus.java b/app/src/main/java/org/ntlab/acanthus_client/Acanthus.java index 8adedf9..3c78739 100644 --- a/app/src/main/java/org/ntlab/acanthus_client/Acanthus.java +++ b/app/src/main/java/org/ntlab/acanthus_client/Acanthus.java @@ -67,7 +67,10 @@ } public Integer getAid() { - if (this.aid == null) this.aid = 1111; + if (aid == null) { + SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); + aid = preferences.getInt("aid", 0); + } return aid; } @@ -75,7 +78,7 @@ return currentAnimation; } - public Collection getAnimationJsonList(){ + public Collection getAnimationJsonList() { return animationJsonList; } @@ -117,7 +120,10 @@ } public void setAid(Integer aid) { - this.aid = aid; + SharedPreferences preferences = getSharedPreferences("prefData", MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + editor.putInt("aid", aid); + editor.commit(); } public void setCurrentAnimation(Animation currentAnimation) { @@ -125,7 +131,7 @@ } //HomeViewModelでしようするためのsetter - public void setAnimationJsonList(Collection sentAnimationJsonList){ + public void setAnimationJsonList(Collection sentAnimationJsonList) { this.animationJsonList.clear(); this.animationJsonList.addAll(sentAnimationJsonList); }