Error:(200, 16) エラー: 不適合な型: ObjectをImageButtonに変換できません:
注意:/Users/Downloads/applepie-android/app/src/main/java/PostFragment.javaの操作は、未チェックまたは安全ではありません。
注意:詳細は、-Xlint:uncheckedオプションを指定して再コンパイルしてください。
:app:compileDebugJavaWithJavac FAILED
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
とエラーが出ました。これはコンパイルがうまくいっていないということでしょうか?
コードは
Java
1call.enqueue(new Callback<UserInfo>() 2 { 3 @Override 4 public void onResponse(Call<UserInfo> call, Response<UserInfo> UserInfoResponse){ 5 String email = UserInfoResponse.body().getEmail(); 6 Integer id = UserInfoResponse.body().getId(); 7 String username = UserInfoResponse.body().getUsername(); 8 Object area = UserInfoResponse.body().getArea(); 9 String bio = UserInfoResponse.body().getAttribute(); 10 String sex = UserInfoResponse.body().getSex(); 11 Object birthday = UserInfoResponse.body().getBirthday() ; 12 ImageButton icon = UserInfoResponse.body().getIcon(); 13 14 15 mailEdit.setText(email); 16 17 passEdit.setText(String.valueOf(id)); 18 if (username !=null) { 19 usernametext.setText(String.valueOf(username)); 20 } 21 if (area !=null) { 22 areatext.setText(String.valueOf(area)); 23 } 24 if (area !=null) { 25 areatext.setText(String.valueOf(area)); 26 } 27 if (bio !=null) { 28 introductiontext.setText(String.valueOf(bio)); 29 } 30 if (sex !=null) { 31 sextext.setText(String.valueOf(sex)); 32 } 33 if (birthday !=null) { 34 birthdaytext.setText(String.valueOf(birthday)); 35 } 36 if (icon !=null) { 37 icon= (ImageButton) findViewById(R.id.icon); 38 final ImageButton finalIcon = icon; 39 icon.setOnClickListener(new View.OnClickListener(){ 40 public void onClick(View v){ 41 42 bitmap = RadiusImage(bitmap); 43 finalIcon.setImageDrawable(null); 44 finalIcon.setImageBitmap(bitmap); 45 } 46 }); 47 48 49 } 50 else { 51 52 53 } 54 } 55 56``
と書きました
エラーはUserInfo.javaの200行目に出ています。
そこのコードは
Java
1public ImageButton getIcon() { 2 return icon; 3 }
のようになっています。
回答1件
あなたの回答
tips
プレビュー