Thursday 15 September 2011

android - Cursor Adapter with ImageView -


I have a cursor adapter for list view. Within this adapter, we have the code below, the item is an image view and I am trying to make it visible and set it to the image name that is in the value coming from the database. As you can see from my logbook when it is empty and even when it is populated, it still fails. I'm assuming that I have to convert the string to bitmap objects or drawables. anyone?

Log Cat:

  06-21 09: 32: 38.020: I / ProjectCarsu (10061): is_stamp: Overview 06 06 09 09: 32: 38.020: I / PROJECTCARUSO (10061): is_stamp2: Overview 06-21 09: 32: 38.020: I / System. Out (10061): Solution Yuri has failed on Bad Bitmap Yuri: Overview 06-21 09: 32: 38.101: I / Project Carous (10061): Is_stamp: null 06-21 09: 32: 38.101: I / PROJECTCARUSO (10061 ): Is_stamp3: blank 06-21 09: 32: 38.101: I / System.out (10061): Hull URI has failed on bad bitmap: if (column index == cursor.get column index (statset.key_CHARTING_STAMPS)) {String is_stamp = cursor.getString (columnIndex); Logs. I ("ProjectCarsusu", "is_stamp0:" + is_stamp); Set the visibility of the scene to set (if_stamp! = Null) {if_stamp.equalsIgnoreCase ("")) // // Log.i ("PROJECTCARUSO", "is_stamp1:" + is_stamp); View.setVisibility (View.INVISIBLE); } Other {Log.i ("projectcarsusu", "is_stamp2:" + is_stamp); View.setVisibility (View.VISIBLE); }} And {Log.i ("PROJECTCARUSO", "is_stamp3:" + is_stamp); View.setVisibility (View.INVISIBLE); }    

  isi_stamp_draw = getResources (). GetDrawable (getResources () GetIdentifier ("drawing /" + is_stamp, null, getActivity (). GetPackageName ())); View.setBackground (is_stamp_draw);    

No comments:

Post a Comment