diff --git a/app/src/main/java/org/ntlab/irisclient/DrawingActivity.java b/app/src/main/java/org/ntlab/irisclient/DrawingActivity.java index 6935caf..1d31151 100644 --- a/app/src/main/java/org/ntlab/irisclient/DrawingActivity.java +++ b/app/src/main/java/org/ntlab/irisclient/DrawingActivity.java @@ -30,6 +30,7 @@ Iris iris = (Iris) this.getApplication(); String rid = iris.getRid(); String nickName = iris.getNickname(); + Boolean isMaster = iris.isMaster(); drawingStateViewModel= new ViewModelProvider(this).get(DrawingStateViewModel.class); //viewModelに必用な情報をセット @@ -55,9 +56,12 @@ drawingStateViewModel.getState().observe(this, new Observer() { @Override public void onChanged(Integer state) { + Class nextActivity = GameMemberActivity.class; + if(isMaster) nextActivity = GameMasterActivity.class;//自分がMasterならMaster用のGame画面へ遷移 + //stateが変わったらゲーム画面へ遷移 if(state == 3) { - Intent intent = new Intent(DrawingActivity.this, GameMemberActivity.class); + Intent intent = new Intent(DrawingActivity.this, nextActivity); startActivity(intent); } }