I have an existing android app. I added a simple widget to it using the following:
- updated my manifest with a
<receiver>
block which provides information about myAppWidgetProvider
implementation - added a new xml files in res/xml with a
<appwidget-provider>
element that contains the height/width/updatePeriod/initialLayout/icon/label attributes - added a simple default layout with an
ImageView
and aTextView
- implemented my
AppWidgetProvider
When I build and deploy this to the emulator my Widget doesn't show up in the list of widgets. Am I missing some step to 'install' the widget? Do I need to do anything special to make it appear in the emulator?
EDIT: Here's what my manifest receiver looks like:
<receiver android:name=".MyAppWidgetProvider"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/my_appwidget_info" />
</receiver>
and here's what my my_appwidget_info.xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:icon="@drawable/ic_logo"
android:label="MySampleApp"
android:minWidth="294dp"
android:minHeight="72dp"
android:updatePeriodMillis="86400000"
android:initialLayout="@layout/my_app_widget" >
</appwidget-provider>