ralphtrent
Member
Hi, I am new to android dev so please bare with me. I have been looking all day and found nothing that does what I want to do.
I have data in a db and I need to manipulate its values when I display it.
here is the code I have so far
When I look at the logCat for my tags I see this:
It looks like I am setting the text too early? AM I? On the screen test (which is the value from the db) still get displayed, but I want "Hello".
Any help is appreciated.
I have data in a db and I need to manipulate its values when I display it.
here is the code I have so far
Code:
adapter = new SimpleCursorAdapter(this, R.layout.clock_item, c, FROM, TO);
ListView lv = (ListView) findViewById(R.id.list);
lv.setAdapter(adapter);
adapter.setViewBinder(new SimpleCursorAdapter.ViewBinder() {
@Override
public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
TextView tv = (TextView)view;
if(columnIndex == 0)
{
Log.i(TAG, "Current Text:" + tv.getText());
tv.setText("Hello");
Log.i(TAG, "Current Text:" + tv.getText());
}
}
Code:
Current Text:
Current Text:Hello
Current Text:test
Any help is appreciated.