Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Appwidgets and SDK 2.0 ContactContracts

Appwidgets and SDK 2.0 ContactContracts

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Appwidgets and SDK 2.0 ContactContracts

Postby xgeraldx » Mon Nov 16, 2009 8:08 pm

My Appwidget has an ImageButton that I'm trying to assign a contact photo for the image. I did an application test and it worked fine, but when I implement it in the Appwidget, it doesn't set the image. Does anyone know how I can pull the contact image using the ContactContracts and make a drawable or .png out of it?

Here is the code that I'm using to set the image on the imagebutton in the Appwidget:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. RemoteViews remoteView = new RemoteViews(context.getPackageName(),R.layout.widget);
  2.  
  3. Uri uri = Uri.withAppendedPath( ContactsContract.Contacts.CONTENT_URI,
  4.  
  5.         config.getString("contactId", "1") );
  6.  
  7. uri = Uri.withAppendedPath( uri,        ContactsContract.Contacts.Photo.CONTENT_DIRECTORY);
  8.  
  9. remoteView.setImageViewUri(R.id.imgContactBtn, uri);
Parsed in 0.011 seconds, using GeSHi 1.0.8.4
xgeraldx
Freshman
Freshman
 
Posts: 4
Joined: Fri Sep 26, 2008 3:58 pm

Top

Postby xgeraldx » Tue Nov 17, 2009 5:02 am

Ok, I figured it out. For some reason I was calling remoteviews again after I already set the variable. It works now.
xgeraldx
Freshman
Freshman
 
Posts: 4
Joined: Fri Sep 26, 2008 3:58 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests