Oops, my bad I was thinking of something else.

On Wed, Sep 30, 2009 at 9:51 AM, nEx.Software
<[email protected]> wrote:
>
> Well, I actually started off with just using the ICON_PACKAGE /
> ICON_RESOURCE method and wanted to use Photo instead. I have tried
> this without ICON_PACKAGE / ICON_RESOURCE to no avail. How do I
> specify the Icon type?
>
> On Sep 30, 9:48 am, Romain Guy <[email protected]> wrote:
>> 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 protected]>
>> 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 <[email protected]> wrote: > Oh
>>
>> yeah, ...
>>
>> > <[email protected]> wrote: > > > The default contacts live
>>
>> folders don't pass photos fr...
> >
>



-- 
Romain Guy
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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