protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_show);
DataBase.cursor.moveToFirst();
TextView First_Word = (TextView) findViewById(R.id.textView1);
TextView First_Read = (TextView) findViewById(R.id.textView2);
First_Word.setText("" + DataBase.cursor.getString(1));
First_Read.setText("" + DataBase.cursor.getString(2));
}
public void right(View v) {
TextView Next_Word = (TextView) findViewById(R.id.textView1);
TextView Next_Read = (TextView) findViewById(R.id.textView2);
if(DataBase.cursor.getPosition() + 1 == DataBase.cursor.getCount())
Toast.makeText(this, "마지막 단어입니다", Toast.LENGTH_SHORT).show();
else
DataBase.cursor.moveToNext();
Next_Word.setText("" + DataBase.cursor.getString(1));
Next_Read.setText("" + DataBase.cursor.getString(2));
}
데이터베이스에서 커서를 첫번째 위치로 옮긴 다음에 출력하고
right 버튼을 누를때마다 커서를 옮겨서 출력하려고 합니다.
그런데 문제는
리스트뷰에서 1~10까지 입력되어 있다고 했을 때
사용자가 화면에서 보았을 때 6~10까지 보일 경우 1에서 2로 넘어가는게 아니라 1에서 6으로 넘어갑니다.
포지션때문인거 같은데...
해결방법을 못찾아서 도움을 요청합니다