<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 RemoteView. I tried something like this
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),R.drawable.yout_bck); remoteViews.setImageViewBitmap(R.id.widget, bitmap); , R.drawable.yout_bck); Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),R.drawable.yout_bck); remoteViews.setImageViewBitmap(R.id.widget, bitmap);
But then it shows that “Widget is not loading”
It should be as the background, because I needed to set the text in the center of the picture :)
source share