A SimpleAdapter is too simple for your case.  Try creating a new class
that overrides the CursorAdapter, which gives you two methods:
newView(..) and bindView(..).  You can still use your XML based layout
inside newView(..) using the LayoutInflater and findById(..):

        @Override
        public View newView( Context context, Cursor cursor, ViewGroup
parent ) {
                LayoutInflater inflater =
(LayoutInflater)context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
                View view = inflater.inflate( R.layout.phone_item, null );

                bindView( view, context, cursor );
                return view;
        }

        @Override
        public void bindView( View view, Context context, Cursor cursor ) {
                // Bind one cursor value to one sub-view
                String display_name = "<INVALID CURSOR>";
                int column = cursor.getColumnIndex( 
Contacts.Phones.DISPLAY_NAME );
                if( column != -1 )
                        display_name;

                // Format the returned cursor value here...

                TextView name_view = (TextView)view.findViewById( R.id.name );
                if( name_view != null )
                        name_view.setText( display_name );
        }



On Oct 27, 8:01 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hello,
> I am working on an application that involves displaying dates from my
> database.  I have the dates formatted within my database using the
> ISO8601 format: "yyyy-MM-dd'T'HH:mm:ss.SSS".  I run my query which
> returns a cursor.  I then map the DATE field within the cursor to my
> TextView.  My issue is that the date is still formatted as "yyyy-MM-
> dd'T'HH:mm:ss.SSS".  My plan was to convert it back to a Date object
> and format it as I like, but I don't see where I can intercept the
> value from the cursor before it is displayed on the TextView... any
> ideas?
>
> Thanks,
> Vince
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to