| | package com.example.cosmosclient.views; |
---|
| | |
---|
| | import android.content.Intent; |
---|
| | import android.media.Image; |
---|
| | import android.os.Handler; |
---|
| | import android.support.v7.app.AppCompatActivity; |
---|
| | import android.os.Bundle; |
---|
| | import android.text.Editable; |
---|
| | import android.text.TextWatcher; |
---|
| | import android.view.View; |
---|
| | import android.widget.Button; |
---|
| | import android.widget.EditText; |
---|
| | import android.widget.ImageButton; |
---|
| | import android.widget.Toast; |
---|
| | |
---|
| | import com.example.cosmosclient.R; |
---|
| | import com.example.cosmosclient.app.Cosmos; |
---|
| | import com.example.cosmosclient.entities.CreateGroupResponse; |
---|
| | import com.example.cosmosclient.entities.Group; |
---|
| | import com.example.cosmosclient.resources.GroupsRest; |
---|
| | |
---|
| | import retrofit2.Call; |
---|
| | import retrofit2.Callback; |
---|
| |
---|
| | import retrofit2.Retrofit; |
---|
| | import retrofit2.converter.jackson.JacksonConverterFactory; |
---|
| | |
---|
| | public class CreateGroupActivity extends AppCompatActivity { |
---|
| | Button createGroupButton; |
---|
| | private Button createGroupButton; |
---|
| | |
---|
| | @Override |
---|
| | protected void onCreate(Bundle savedInstanceState) { |
---|
| | super.onCreate(savedInstanceState); |
---|
| |
---|
| | |
---|
| | //グループ作成に必要な情報の取得 |
---|
| | Cosmos app = (Cosmos) getApplication(); |
---|
| | uId = app.getuId(); |
---|
| | ////サインアップでトークンが返ってきてないため一時コメントアウト |
---|
| | token = app.getToken(); |
---|
| | //token="abcdef"; |
---|
| | |
---|
| | //retrofitの処理 |
---|
| | final Retrofit retrofit = new Retrofit.Builder() |
---|
| | .baseUrl("http://nitta-lab-www.is.konan-u.ac.jp/cosmos/") |
---|
| |
---|
| | public void onResponse(Call<CreateGroupResponse> call, Response<CreateGroupResponse> response) { |
---|
| | if (response.isSuccessful()) { |
---|
| | //成功時 |
---|
| | CreateGroupResponse result = response.body(); |
---|
| | //app/CosmosにgIdを保存 |
---|
| | Cosmos app = (Cosmos)getApplication(); |
---|
| | app.setgId(result.gId); |
---|
| | |
---|
| | Intent intent = new Intent(getApplication(), RequestListActivity.class); |
---|
| | |
---|
| | |
---|
| | // //確認用 |
---|
| | // System.out.println(result.getgId()); |
---|
| | // System.out.println(result.getName()); |
---|
| | // System.out.println(result.getRequests()); |
---|
| | // System.out.println(result.getUri()); |
---|
| | |
---|
| | startActivity(intent); |
---|
| | Toast.makeText(CreateGroupActivity.this, |
---|
| | "グループを作成しました", Toast.LENGTH_SHORT).show(); |
---|
| | finish(); |
---|
| |
---|
| | |
loginでもうuId手打ちなんてしなくていいんです
responseの変数名の変更
確認しました。
マージします。
c772ec2
intomaster
fromCreateGroup
on 18 Jul 2019