【发布时间】:2012-01-20 01:26:13
【问题描述】:
<RelativeLayout
android:id="@+id/widget"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/my_background"
android:orientation="vertical" >
现在我想使用 RemoteViews 将此背景更改为“@drawable/your_bck”。我试过这样的东西
Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),R.drawable.yout_bck);
remoteViews.setImageViewBitmap(R.id.widget, bitmap);
但我随后显示“小部件无法加载”
它必须作为背景,因为我需要在图像的中心设置一个文本:)
【问题讨论】:
标签: java android android-layout android-widget