Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 926
Wawanopoulos Ertz Avatar asked Dec 05 '25 13:12

Wawanopoulos Ertz


1 Answers

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

like image 127
SIr Codealot Avatar answered Dec 07 '25 04:12

SIr Codealot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!