You need assign the tvText TextView
to txt
final TextView txt=null;
scAdapter.setViewBinder(new SimpleCursorAdapter.ViewBinder() {
public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
if (view.getId() == R.id.tvText ){
//add this line
txt = (TextView)view;
if (cursor.getInt(cursor.getColumnIndex(DB.COLUMN_FLAG)) ==1 ){
String goal = cursor.getString(cursor.getColumnIndex(DB.COLUMN_GOAL));
txt.setText(goal);
txt.setPaintFlags(txt.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
}
else txt.setPaintFlags(txt.getPaintFlags() & (~ Paint.STRIKE_THRU_TEXT_FLAG));
}
return false;
}
});