The problem with the my list view is when you scroll up after you have reached the bottom the numbers keep incrementing. I wanted the numbers to be fixed. After the end of list view is reached and the user scrolls up. I am trying to filter the number of rows. I would post an image but I dont have the amount of points needed.
public void bindView(View v, Context context, Cursor c) {
// do your magic inhere :) the cursor will be at the correct row position
System.out.println("please select a cursor");
if(name_text != null) {
String mFinal = answer.replaceAll("<ENTER>", "\n").replaceAll("<ENTER>", "").replaceAll("<COMMA>", ",");
name_text.setText(String.valueOf(mFinal));
correctanswer.setText(answer);
questno.setText(String.valueOf(counter));
counter++;
}
if(answer.equals(userreal))
{
System.out.println("are the two values equal");
imageView.setImageResource(R.drawable.plus);
String mFinal = name.replaceAll("<ENTER>", "\n").replaceAll("<ENTER>", "").replaceAll("<COMMA>", ",");
name_text.setText(String.valueOf(mFinal));
myanswertext.setText(userreal);
}
else
{
imageView.setImageResource(R.drawable.redcross);
String mFinal = name.replaceAll("<ENTER>", "\n").replaceAll("<ENTER>", "").replaceAll("<COMMA>", ",");
name_text.setText(String.valueOf(mFinal));
myanswertext.setText(userreal);
System.out.println("are the values not equal");
}
}
Simply use the Cursor’s position / index: