0

I was trying to set my widget's image view with contact's thumbnail. I was trying with activity's image view and I was able to get the thumbnail but when I tried to get the same with setImageViewUri in RemoteViews,its not updating my widget's image view.I have posted my code snippet below..

ImageView mine = (ImageView) findViewById(R.id.pickcontact);
                if (phone_thumbnail != null) {
                    mine.setImageURI(Uri.parse(phone_thumbnail));
                    Log.d("Pick", "Image is set");

                }

this code is working fine.

RemoteViews views = new RemoteViews(getPackageName(),
                        R.layout.widget_alyout);
                if (phone_thumbnail != null) {

                    views.setImageViewUri(R.id.widget_icon_imageview,
                            Uri.parse(phone_thumbnail));

                } else {
                    views.setImageViewResource(R.id.widget_icon_imageview,
                            R.drawable.image);

                }

this code is not working.both setImageViewUri and setImageViewResource not updating my widget's imageview.Any idea? please help. Thanks, Jeyanthi

Jey
  • 93
  • 1
  • 8

1 Answers1

-1

I used

rv.setImageViewBitmap(R.id.image_photo, bitmap); whre rv = RemoteView reference

and it works fine for me. One thing with this approach is you have to create bitmap for your contact image.

Umesh G
  • 3
  • 1
  • 1