Why are you setting a bitmap and a resource for the icon? You are also not
specifying the icon type.

On Sep 30, 2009 9:44 AM, "nEx.Software" <email.nex.softw...@gmail.com>
wrote:


I knew I should have included that... This is a bit messy at the
moment.

   private static final String[] CURSOR_COLUMNS = new String[]
{ BaseColumns._ID, LiveFolders.NAME, LiveFolders.DESCRIPTION,
LiveFolders.INTENT, LiveFolders.ICON_PACKAGE,
LiveFolders.ICON_RESOURCE, LiveFolders.ICON_BITMAP };

   public static MatrixCursor loadNewData(ContentProvider cp, Uri
uri)
   {
       MatrixCursor mc = new MatrixCursor(CURSOR_COLUMNS); Cursor
groupContacts = null;
       try
       {
          groupContacts = cp.getContext().getContentResolver().query
(Uri.parse("content://contacts/groups/name/" + uri.getLastPathSegment
() + "/members"), CONTACTS_COLUMN_NAMES, null, null, null);

          while(groupContacts.moveToNext())
          {
                  String timesContacted = "Times contacted: " +
groupContacts.getInt(2);

                  Bitmap Icon = People.loadContactPhoto(cp.getContext(),
ContentUris.withAppendedId(People.CONTENT_URI, groupContacts.getLong
(0)), R.drawable.icon, null);
                  ByteArrayOutputStream baos = new ByteArrayOutputStream();
Icon.compress(CompressFormat.PNG, 0, baos);
                  Object[] rowObject = new Object[]
                  {
                      groupContacts.getLong(0),
                      groupContacts.getString(1),
                      timesContacted,
                      ContentUris.withAppendedId(People.CONTENT_URI,
groupContacts.getLong(0)),
                      cp.getContext().getPackageName(),
                      R.drawable.icon,
                      baos.toByteArray()
                  };
                  mc.addRow(rowObject);
          }

         return mc;
       }
       finally
       {
               if (groupContacts != null && groupContacts.isClosed() !=
true)
               {
                       groupContacts.close();

} } } On Sep 30, 9:35 am, Romain Guy <romain...@google.com> wrote: > Oh
yeah, ...

> <email.nex.softw...@gmail.com> wrote: > > > The default contacts live
folders don't pass photos fr...

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