I have a Widget that toggles between two images, the widget changes each time a user clicks on it So I define a layout for this widget as follows
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/parrotstate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:clickable="true"
android:src="@drawable/widget_awake" />
</RelativeLayout>
In the AppWidgetProvide class
, I need to read the attribute android:src to know which image is set.
Normally I use findViewById
in the Activity class but here it is AppWidgetProvide class