Go Back   Android Forums > Android Development > Application Development
Application Development Dev Lounge for the Coder Folks
Gamers - Check out our new sister sites!
Nintendo Wii U!    |    OUYA - $99 Android System!

test: Reply
 
LinkBack Thread Tools
Old December 2nd, 2010, 02:49 PM   #1 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Mar 2010
Posts: 67
 
Device(s): Droid (A855)
Carrier: Not Provided

Thanks: 0
Thanked 6 Times in 3 Posts
Default Modify data in a cursor

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
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());
 }
}
When I look at the logCat for my tags I see this:
Code:
Current Text:
Current Text:Hello
Current Text:test
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.

ralphtrent is offline  
Reply With Quote
Sponsors
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:31 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.