Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old October 30th, 2010, 11:55 PM   #1 (permalink)
New Member
 
Join Date: Oct 2010
Location: Nizhniy Novgorod, Russia
Posts: 9
 
Device(s): LG Optimus
Thanks: 0
Thanked 1 Time in 1 Post
Question How to get contact's photo for appwidget?

Hi!
I googled for some days and tested quite a few scripts to get contact's photo...
My last version:
public static Bitmap loadContactPhoto(Context context, String myph) {
ContentResolver cr=(ContentResolver) context.getContentResolver();
InputStream input = ContactsContract.Contacts.openContactPhotoInputStr eam(cr, Uri.parse("tel:" + myph));
return BitmapFactory.decodeStream(input);
}

The main problem is to define ContentResolver... If I use image from drawable, everything is ok!

remoteViews.setImageViewResource(R.id.ConButton,R. drawable.ConPhoto);

But I'd like to use contact's photo... Help please!

intsurfer is offline  
Reply With Quote
Sponsors
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AppWidget refresh vittochan Application Development 0 November 24th, 2010 02:22 AM
How to get contact's photo in appwidget? intsurfer Introductions 2 October 30th, 2010 11:45 PM
App into AppWidget (need help) abun Application Development 3 May 26th, 2010 08:01 AM
Debug AppWidget dpak23in Developer 101 1 March 14th, 2010 07:41 PM
Debug AppWidget dpak23in Application Requests 0 March 11th, 2010 12:50 AM



All times are GMT -5. The time now is 11:34 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo