리스트뷰에서 아이템 클릭시 레이아웃이 변경됩니다.
기존 아이템클릭시 ExelLat,ExelLon에 변수가 저장됩니다.
이 변수를 새로운 레이아웃에서 사용할 방법이 뭘까요 ??
list_excel.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent = new Intent(getApplicationContext(),MapActivity.class);//다음 넘어갈 클래스 지정
startActivity(intent);
try {
String imgRes = arrayAdapter.getItem(position);
InputStream inputStream = getBaseContext().getResources().getAssets().open("dd.xls");
workbook = Workbook.getWorkbook(inputStream);
sheet = workbook.getSheet(0);
String ExcelLat = sheet.getCell(3, r[position]).getContents(); // 위도
String ExcelLon = sheet.getCell(4, r[position]).getContents(); // 경도
}
catch (IOException e) {
e.printStackTrace();
}
catch (BiffException e) {
e.printStackTrace();
}
}
});