안드로이드 질문 드립니다.

조회수 599회
public class CommentItemView extends LinearLayout {
TextView comment;
TextView id;
public CommentItemView(Context context) {
    super(context);
}

public CommentItemView(Context context, @androidx.annotation.Nullable AttributeSet attrs) {
    super(context, attrs);
}

private void init(Context context){
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
    inflater.inflate(R.layout.listview_act, this, true);

    comment = findViewById(R.id.comment);
    id = findViewById(R.id.id);
}

public void setComment(String Comment){
    comment.setText(Comment);
}

public void setId(String Id){
    id.setText(Id);
}
}

커스텀 리스트뷰를 만들기 위해서 새로운 액티비티를 만들고 생성자를 만들었는데 @androidx.annotation.Nullable AttributeSet attrs 이부분에서 에러가 나네요 구글에 검색해서 compile 'com.android.support:support-annotations:23.4.0' 추가도 해봤는데 WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html Affected Modules: app 이런식으로 오류가 나네요

  • (•́ ✖ •̀)
    알 수 없는 사용자
  • compile 을 implementation로 바꿔서 실행하세요. 주동혁 2019.1.21 15:55

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)