Search code examples
androidimageviewremoteviewappwidgetprovider

setImageViewUri from URL on remote view in android widget


I try to set image from url with remote view. Here is the code that i use :

   rv = new RemoteViews(mContext.getPackageName(), R.layout.widget_item_default);
    WidgetItem item = mWidgetItems.get(position);
    rv.setImageViewUri(R.id.imageDeal, Uri.parse(item.urlImage));

And the code of the layout :

 <ImageView
     android:id="@+id/imageDeal"
     android:layout_width="fill_parent"
     android:layout_height="80dp"
     android:layout_marginBottom="2dp"
     android:layout_marginLeft="4dp"
     android:layout_marginRight="4dp"
     android:adjustViewBounds="true"
     android:scaleType="centerCrop"
     android:src="@drawable/mem" />

Widget is launched but there is no image printed in the imageView.


Solution

  • Your question is answered here: https://groups.google.com/forum/?fromgroups=#!topic/android-developers/jupslaeAEuo