리스트뷰에 나오는 내용들이
엑셀에 10번째 Row 까지만 데이터가 있다치면
그 10번이 계속해서 반복된 것이 출력됩니다..
1
2
3
4
5
6
7
8
9
10
1
2
3
4
.
.
이런식으로 말이죠ㅜㅜ; 코딩 어딘가를 손봐야할텐데 이것저것 바꿔봐도 안되네요 도와주십시오ㅜ
copyExcelDataToDatabase();
Button button01 = (Button) findViewById(R.id.button01);
button01.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
dbAdapter.open();
Cursor result = dbAdapter.fetchAllNotes();
result.moveToFirst();
while (!result.isAfterLast()) {
String resultStr = "";
String title = result.getString(1);
String body = result.getString(2);
String posi = result.getString(3);
resultStr += title + ", " + body + "," + posi + "\n";
dataArr.add(resultStr); // 엑셀로부터 가져온 문자열을 위에서 선언한 문자 배열 변수 dataArr 에 추가한다.
result.moveToNext();
}
/*TextView textView01 = (TextView) findViewById(R.id.textView01);
textView01.setText(resultStr);*/
result.close();
dbAdapter.close();
ArrayAdapter<String> Adapter = new ArrayAdapter<String> (getBaseContext(),
android.R.layout.simple_list_item_1, dataArr);
listView01.setAdapter(Adapter);
}
});