Handler handler_kublah_comment = new Handler(){
public void handleMessage(Message msg){
commenthm = xml2HashMap(commentData,"UTF-8");
//final ListViewHolder listviewHolder = new ListViewHolder(); 사용하지 않았음
//listviewHolder.commentListview = (ListView) act.findViewById(R.id.kublah_comment_list);
commentListAdapter commentlistAdapter = new commentListAdapter(act,R.layout.kublah_comment_layout,commenthm); // the layout for the list view is added
ListView commentlistView = (ListView) act.findViewById(R.id.kublah_comment_list);
commentlistView.setAdapter(commentlistAdapter); //null pointer error
};
};
리스트뷰안에 들어있는 리스트뷰에다 다음과 같이 어뎁터를 이용해 레이아웃을 합성해주려고 합니다.
마지막줄
commentlistView.setAdapter(commentlistAdapter); //null pointer error
요기서 널포인터 에러가 나는거 보니
commentListAdapter commentlistAdapter = new commentListAdapter(act,R.layout.kublah_comment_layout,commenthm);
ListView commentlistView = (ListView) act.findViewById(R.id.kublah_comment_list);
요 두줄 중에 한 줄에서 kublah_comment_list를 못찾고 있는 것 같습니다.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/kublah_top"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#FFBB00" >
<ImageButton
android:id="@+id/kublah_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@android:drawable/alert_dark_frame" />
<ImageButton
android:id="@+id/kublah_drawer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@android:drawable/alert_light_frame" />
<ImageButton
android:id="@+id/kublah_write"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@android:drawable/alert_light_frame" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/kublah_top" >
<ListView
android:id="@+id/kublah_contentlist"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true" >
</ListView>
</RelativeLayout>
</RelativeLayout>
메인 xml파일안에 리스트뷰가 있고
그 리스트 뷰 안에
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/kublah_row_layout" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/kublah_nameLayout">
<TextView
android:id="@+id/kublah_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name" />
</LinearLayout>
<LinearLayout
android:id="@+id/kublah_textLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/kublah_nameLayout">
<TextView
android:id="@+id/kublah_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="kublah Text" />
</LinearLayout>
<RelativeLayout
android:id="@+id/kublah_commentBtnLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/kublah_textLayout">
<ImageButton
android:id="@+id/kublah_commentRequestBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@android:drawable/alert_dark_frame"
android:background="#00000000"/>
</RelativeLayout>
<FrameLayout
android:id="@+id/kublah_comment_showFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/kublah_commentBtnLayout">
<TextView
android:id="@+id/test_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ListView
android:id="@+id/kublah_comment_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
</FrameLayout>
<RelativeLayout
android:id="@+id/kublah_comment_insertBtnLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/kublah_comment_showFrame">
<ImageButton
android:id="@+id/comment_activationBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:src="@android:drawable/alert_light_frame"
android:background="#00000000" />
<ImageButton
android:id="@+id/comment_insertBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/comment_activationBtn"
android:src="@android:drawable/arrow_up_float" />
<EditText
android:id="@+id/comment_here"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:hint="comment here"
android:ems="10" >
<requestFocus />
</EditText>
</RelativeLayout>
</RelativeLayout>
다음과 같은 리스트뷰가 삽입되어 있어
이 리스트뷰에 내용을 출력한 후
큰 리스트뷰 상에 출력을 해주려고 합니다.
이렇게 두개의 리스트 뷰를 사용하는 경우 어떻게 구성을 해야하는지 알려주시면ㅜ
감사하겠습니다^^;;