I've tried two scenarios of this.
1. I used R.layout.mylayout
remoteView.setBitmap(R.layout.main, "setBackgroundDrawable",
((BitmapDrawable) context.getResources().getDrawable
(R.drawable.background)).getBitmap());
12-09 19:55:06.972: WARN/AppWidgetHostView(626): updateAppWidget
couldn't find any view, using error view
12-09 19:55:06.972: WARN/AppWidgetHostView(626):
android.widget.RemoteViews$ActionException: can't find view:
0x7f030006
2. I put an id in my .xml's LinearLayout tag like android:id="@+id/
mylayout" and I tried to use that.
remoteView.setBitmap(R.id.mylayout, "setBackgroundDrawable",
((BitmapDrawable) context.getResources().getDrawable
(R.drawable.background)).getBitmap());
12-09 21:37:59.710: WARN/AppWidgetHostView(626):
android.widget.RemoteViews$ActionException: view:
android.widget.LinearLayout doesn't have method: setBackgroundDrawable
(android.graphics.Bitmap)
Neither way seemed to work.
On Dec 9, 4:08 pm, Paul Turchenko <[email protected]> wrote:
> how about setBitmap(R.layout.you_view_id, "setBackgroundDrawable",
> mYourBitmapDrawable)?
>
> On Dec 9, 10:58 pm,pcm2a<[email protected]> wrote:
>
>
>
> > I have a simple layout:
> > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> > android"
> > android:background="@drawable/background"
> > android:layout_height="fill_parent"
> > android:layout_width="wrap_content"
> > android:orientation="vertical">
>
> > In my method onUpdate I can get the remote view:
>
> > RemoteViews remoteView = new RemoteViews(context.getPackageName(),
> > R.layout.somelayout");
>
> > I cannot find any information on how to change or hide the background
> > image.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en