diff --git a/app/src/main/java/com/example/cosmosclient/views/JoinGroupByIDActivity.java b/app/src/main/java/com/example/cosmosclient/views/JoinGroupByIDActivity.java index d62ef21..d6c8dda 100644 --- a/app/src/main/java/com/example/cosmosclient/views/JoinGroupByIDActivity.java +++ b/app/src/main/java/com/example/cosmosclient/views/JoinGroupByIDActivity.java @@ -67,21 +67,30 @@ @Override public void onResponse(Call call, Response response) { if (response.isSuccessful()) { -// JoinGroupResponse result = response.body(); //成功時 - JoinGroupResponse result = response.body(); - Group g = new Group(result.gId,result.uri,result.name,uId); + final JoinGroupResponse result = response.body(); + //追加ボタンに関する記述 + test.setText(result.name); + Button AddBtn = (Button)findViewById(R.id.Addbutton); + AddBtn.setVisibility(View.VISIBLE); - //app/CosmosにgIdを保存 - Cosmos app = (Cosmos)getApplication(); - app.setCurrentGroup(g); + AddBtn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Group g = new Group(result.gId, result.uri, result.name, uId); - Intent intent = new Intent(getApplication(), RequestListActivity.class); - startActivity(intent); - //ここで成功の処理を記述 - finish(); + //app/CosmosにgIdを保存 + Cosmos app = (Cosmos) getApplication(); + app.setCurrentGroup(g); - } else { + Intent intent = new Intent(getApplication(), RequestListActivity.class); + startActivity(intent); + finish(); + + } + }); + + }else { //onFailureでキャッチできないエラー用 //ここでエラーの処理を記述 test.setText("失敗");