<RelativeLayout
android:id="@+id/widget"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/my_background"
android:orientation="vertical" >
And now I want to change this background to “@drawable/your_bck” using RemoteViews. I tried something like this
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),R.drawable.yout_bck);
remoteViews.setImageViewBitmap(R.id.widget, bitmap);
But i then it shows “Widget failed to load”
It must be as a background because i need to set a text on the center of image 🙂
You’re calling
setImageViewBitmapon aRelativeLayout. ARelativeLayoutis not anImageView. You could put anImageViewin there instead that fills theRelativeLayoutand call it on that.