프래그먼트내의 리스트뷰(setAdapter)
조회수 1885회
프래그먼트내에 다시 프래그먼트를 이용해 어플리케이션을 구성중입니다. 이 두번 중첩(?)된 프래그먼트내에서 리스트뷰를 사용하려고 하는데요 setadapter부분만 들어가면 어플리케이션이 중지가 되네요.. 무엇이 문제일까요? public class ThirdLayout extends Fragment { private ListView noticeListView; private NoticeListAdapter adapter; private List noticeList;
View v;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
v = inflater.inflate(R.layout.third_layout, container, false);
noticeListView = (ListView) v.findViewById(R.id.noticeListView);
noticeList= new ArrayList<Notice>();
noticeList.add(new Notice("공지사항1","1234","2018-01-04"));
noticeList.add(new Notice("공지사항1","1234","2018-01-04"));
noticeList.add(new Notice("공지사항1","243","2018-01-04"));
noticeList.add(new Notice("공지사항1","1243","2018-01-04"));
adapter = new NoticeListAdapter(getActivity(), noticeList);
noticeListView.setAdapter(adapter); << 요넘이 있으면 종료가되고 요넘을 없애면 실행은 됩니다...
댓글 입력