일단 전체 코드는 이렇습니다.
HashMap<String, String> map = new HashMap<String, String>();
map.put("idx", idx);
map.put("b_idx", b_idx);
map.put("category", category);
map.put("product", product);
map.put("size", size);
map.put("building", building);
map.put("floor", floor);
map.put("position", position);
oslist.add(map);
adapter = new SimpleAdapter(ThirdDetailActivity.this, oslist, R.layout.activity_third_detail_list,
new String[] {
"category",
"product",
"size",
"building",
"floor",
"position"
},
new int[] {
R.id.processCategory,
R.id.processProduct,
R.id.processSize,
R.id.processBuilding,
R.id.processFloor,
R.id.processPosition
});
listView = (ListView) findViewById(R.id.listView);
listView.setAdapter(adapter);
processAddBtn = (Button) listView.findViewById(R.id.processAddBtn);
processAddBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, 0);
}
});
이 코드에 있는 리스트뷰가 있는데 여기에 버튼이 하나 달려있습니다.
근데 온클릭 리스너에 NullPointerException이 발생합니다. 왜 그러는지는 아는데
어떻게 리스너를 달아줘야할지 모르겠습니다 ㅠ