I update the text of my TextSwitcher in the code of setViewValue. But in case database value is not changed, I would like to avoid its update. Here is my current code:
public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
int viewId = view.getId();
switch(viewId) {
case R.id.timetext:
TextSwitcher twTime = (TextSwitcher) view;
// something is wrong in the next line
if (!cursor.getString(columnIndex).equals(getText(viewId)))
{
twTime.setText(cursor.getString(columnIndex));
}
return true;
Somehow, the data is still updated. Why?
Looks like getText()
doesn't work properly with TextSwitcher
. How to get its value?