A SimpleCursorAdapter does have the smarts to handle images. You will
need to write a custom
adapter that expect images (bitmaps) and will display them.
At a minimum your adapter will have to redefine "getView" and return a
view upon completion.


On Sep 7, 8:53 pm, Atluri ajith <atluriaj...@gmail.com> wrote:
> Hi,
>
> i"m trying to display image with name in listview.
> My content is coming from database using SimpleCursorAdapter.
>
> When i'm trying with this below code getting force close.
>
>         setContentView(R.layout.places);
>                 DatabaseHelper dbHelper = new
> DatabaseHelper(this.getApplicationContext());
>                 DbLoc = dbHelper.getWritableDatabase();
>                 String[] DBcolumns = new String[]{DatabaseHelper.LocationName,
> DatabaseHelper.FriendMobile};
>                 Cursor cursor = DbLoc.rawQuery("SELECT "+
> DatabaseHelper.LocationName +" ,"+ DatabaseHelper.LocationImage + "
> FROM " + DatabaseHelper.LOCATIONTABLE , null);
>                 // the desired columns to be bound
>                 String[] columns = new String[] { DatabaseHelper.LocationName,
> DatabaseHelper.LocationImage };
>                 // the XML defined views which the data will be bound to
>                 int[] to = new int[] { R.id.toptext, R.id.icon };
>                 cursorAdapter = new SimpleCursorAdapter(this, 
> R.layout.placeslist,
> cursor, columns, to);
>                 listContent.setAdapter(cursorAdapter);

-- 
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

Reply via email to