I have a widget layout with a drawable background:
<RelativeLayout
android:id="@+id/basic_widget_layout"
android:background="@drawable/basic_widget_style_2"
android:clickable="true" >
@drawable/basic_widget_style_2
is a layer-list of two shapes.
I also have a configuration activity that displays a preview of my widget for real-time tweaking:
<include android:id="@+id/preview_include"
layout="@layout/basic_widget_layout" />
I'm trying to programmatically tweak @drawable/basic_widget_style_2
through my configuration activity and see the real-time results in @+id/preview_include
.
In my configuration activity I have the specific appWidgetId that launched me, so my question would be - Is there a possible way to obtain the @drawable/basic_widget_style_2
that belongs to the widget that launched my activity?
Additionally, how do I invalidate the <include>
-ed layout background drawable?
It seems that no matter what I do, the layout remains static (tried using invalidate(), refreshDrawable() and more tricks I've seen).