質問編集履歴
1
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -161,3 +161,95 @@
|
|
161
161
|
どのようにJSONデータ型に対応するか検討がつかず質問させていただきます。
|
162
162
|
|
163
163
|
ご経験ある方、ご指南お願いします!
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
# 追加
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
## エラー内容
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
```
|
180
|
+
|
181
|
+
Error:(42, 51) エラー: 不適合な型: Call<List<ListImage>>をCall<ListImage>に変換できません:
|
182
|
+
|
183
|
+
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
|
184
|
+
|
185
|
+
> Compilation failed; see the compiler error output for details.
|
186
|
+
|
187
|
+
```
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
## エラー箇所
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
MainActivity.java
|
196
|
+
|
197
|
+
```
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
public class MainActivity extends AppCompatActivity {
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
private void showMember(){
|
212
|
+
|
213
|
+
Retrofit retrofit = new Retrofit.Builder()
|
214
|
+
|
215
|
+
.baseUrl("http://candii.tk/")
|
216
|
+
|
217
|
+
.addConverterFactory(GsonConverterFactory.create())
|
218
|
+
|
219
|
+
.build();
|
220
|
+
|
221
|
+
ImageClient service = retrofit.create(ImageClient.class);
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
Call <ListImage> call2 = service.listImages(); ★ここです。★
|
228
|
+
|
229
|
+
call2.enqueue(new Callback<ListImage>() {
|
230
|
+
|
231
|
+
@Override
|
232
|
+
|
233
|
+
public void onResponse(Call<ListImage> call, Response<ListImage> response) {
|
234
|
+
|
235
|
+
List<Image> listImage = response.body().getListImages();
|
236
|
+
|
237
|
+
int s = listImage.size();
|
238
|
+
|
239
|
+
for(int i = 0; i < s; i++){
|
240
|
+
|
241
|
+
Log.d("debug3", listImage.get(i).getEn_title());
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
}
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
```
|