[인터돌™] 공부 해보자!! 열심히~~~

반응형
작업도중 로그캣에 아래와 같은 오류 메시지가 뜬다.

07-15 10:25:55.515: ERROR/AndroidRuntime(686): Caused by: java.lang.RuntimeException: Your content must have a ExpandableListView whose id attribute is 'android.R.id.list'


레이아웃 xml의 구성은 아래와 같다.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">
   
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="한방에 되어주면 안되겠니??"
    />
    <ExpandableListView
        android:id="@+id/android:list"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
    ></ExpandableListView>
   
    <Button
        android:id="@+id/attendance_list_main_btn1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="메인화면의 임시 버튼"
    ></Button>
</LinearLayout>

이렇게 해두고 setContentView(R.layout.attendance_list_main); 를 할 때 찍히는 에러 메시지인데 LiveView의 경우는 다른 위젯이랑 좀 다르게 취급하는지 기본적으로 화면에는 찍히지 않는다. setListAdapter(m_Adapter); 를 해줄 때 찍히게 되는데 위와같은 에러가 나는 이유는 xml의 빨간색 부분인 android:id="@+id/android:list" 가 android:list 로 되어있어야 하기 때문이다. 다른 이름으로 지정할 경우 에러가 난다.


이 글을 공유합시다

facebook twitter googleplus kakaoTalk kakaostory naver band