마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

안녕하세요 안드로이드 공부중 calendar와 inflate관련 에러가 생겨서 질문올립니다 ㅜ [closed]

0 추천

calendar.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <org.androidtown.calendarmemo.CalendarMonthView
        android:id="@+id/monthView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:stretchMode="columnWidth"
        android:background="#dcdbdb"
        />
</LinearLayout>

- Mk_Calendar

private void init(Context context, CalendarMonthAdapter adapter){
    mContext = context;

    // inflate XML layout
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
    inflater.inflate(R.layout.calendar, null);

    /*monthView = (CalendarMonthView) findViewById(R.id.monthView);
    monthViewAdapter = adapter;
    monthView.setAdapter(monthViewAdapter);*/

    // 리스너 설정
   /* monthView.setOnDataSelectionListener(new OnDataSelectionListener() {
        public void onDataSelected(AdapterView parent, View v, int position, long id) {
            // 현재 선택한 일자 정보 표시
            MonthItem curItem = (MonthItem) monthViewAdapter.getItem(position);
            int day = curItem.getDay();

            Log.d("MainActivity", "Selected : " + day);
        }
    });*/
}

calendar.xml을 인플레이트 시키려고하는데 

inflater.inflate(R.layout.calendar, null);

위 부분에서 에러가 뜨내요 ㅜ

E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: org.androidtown.calendar.month, PID: 27023
                  android.view.InflateException: Binary XML file line #6: Binary XML file line #6: Error inflating class org.androidtown.calendarmemo.CalendarMonthView
                     

org.androidtown.calendarmemo.CalendarMonthView

는 Custom GridView입니다.

 

문제가 뭐일까요.. 그리고 해결방법은 어떻게해야될까요...

 

감사합니다.

 

 

 

 

 

 

 

 

 

 

 

질문을 종료한 이유: 답을 찾음
초보초보초보 (160 포인트) 님이 2016년 12월 29일 질문
초보초보초보님이 2017년 1월 3일 closed

1개의 답변

0 추천
XML 리소스에 참조 시킨 View가 실제 경로와 일치하는지 확인해보세요.

오픈소스 긁어다가 붙여넣기 했을때 레이아웃 파일의 패키지경로 수정 안했을때 발생했던 에러랑 비슷하네요.
Development Guy (70,570 포인트) 님이 2017년 1월 2일 답변
감사합니다. xml 참조경로가 문제였었네요
...