[android-developers] Re: Inserting Data into a Cursor?
Alright, Thanks for the help! On Jun 24, 10:24 am, Mark Murphy wrote: > nbadal wrote: > > Would something like this work? > > > @Override > > public void bindView(View view, Context context, Cursor cursor) { > > TextView daysUntil = (TextView) view.findViewById(R.id.daysuntil); > > > String days = /* Calculations Here */ > > > daysUntil.setText(days); > > > super.bindView(view, context, cursor); > > } > > I'd do the super.bindView() before putting in your overriding value, to > be safe, but otherwise I suspect that will work. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Inserting Data into a Cursor?
nbadal wrote: > Would something like this work? > > @Override > public void bindView(View view, Context context, Cursor cursor) { > TextView daysUntil = (TextView) view.findViewById(R.id.daysuntil); > > String days = /* Calculations Here */ > > daysUntil.setText(days); > > > super.bindView(view, context, cursor); > } I'd do the super.bindView() before putting in your overriding value, to be safe, but otherwise I suspect that will work. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Inserting Data into a Cursor?
Would something like this work? @Override public void bindView(View view, Context context, Cursor cursor) { TextView daysUntil = (TextView) view.findViewById(R.id.daysuntil); String days = /* Calculations Here */ daysUntil.setText(days); super.bindView(view, context, cursor); } On Jun 24, 10:13 am, nbadal wrote: > So if I wanted to intercept the date data from the database, then do > my calculations, then send that number back out to a textview in the > list item, what would I need to do? > > On Jun 24, 10:07 am, Marco Nelissen wrote: > > > > > You can have your own CursorAdapter, and in its bindView do whatever > > calculations and data mapping you need. > > > On Tue, Jun 23, 2009 at 7:19 PM, nbadal wrote: > > > > Hello, I'm looking for a way to insert data into a cursor that is > > > separate from the SQL database it retrieves the rest of the > > > information from. > > > Is there any way to to this, or is there a different way to add more > > > information to a list view item? > > > > What I'm trying to do is to use a date column for each entry in the > > > list to calculate the number of days until that date (and then put > > > that number in the list item). > > > I know how to get the value, but I just cant find a way to put it into > > > the list without it being in the cursor. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Inserting Data into a Cursor?
nbadal wrote: > Hello, I'm looking for a way to insert data into a cursor that is > separate from the SQL database it retrieves the rest of the > information from. You do not insert into Cursors. You insert into the SQLiteDatabase or ContentProvider or other source of the Cursor. > Is there any way to to this, or is there a different way to add more > information to a list view item? Override bindView() in your Adapter and pour in the additional information per row. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Inserting Data into a Cursor?
So if I wanted to intercept the date data from the database, then do my calculations, then send that number back out to a textview in the list item, what would I need to do? On Jun 24, 10:07 am, Marco Nelissen wrote: > You can have your own CursorAdapter, and in its bindView do whatever > calculations and data mapping you need. > > > > On Tue, Jun 23, 2009 at 7:19 PM, nbadal wrote: > > > Hello, I'm looking for a way to insert data into a cursor that is > > separate from the SQL database it retrieves the rest of the > > information from. > > Is there any way to to this, or is there a different way to add more > > information to a list view item? > > > What I'm trying to do is to use a date column for each entry in the > > list to calculate the number of days until that date (and then put > > that number in the list item). > > I know how to get the value, but I just cant find a way to put it into > > the list without it being in the cursor. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Inserting Data into a Cursor?
You can have your own CursorAdapter, and in its bindView do whatever calculations and data mapping you need. On Tue, Jun 23, 2009 at 7:19 PM, nbadal wrote: > > Hello, I'm looking for a way to insert data into a cursor that is > separate from the SQL database it retrieves the rest of the > information from. > Is there any way to to this, or is there a different way to add more > information to a list view item? > > What I'm trying to do is to use a date column for each entry in the > list to calculate the number of days until that date (and then put > that number in the list item). > I know how to get the value, but I just cant find a way to put it into > the list without it being in the cursor. > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---