1

I have one configuration activity and multiple app widgets for the same app. When i install the app widget on the app widget host, first the configuration activity gets fired and then it calls the update function of the selected app widget. Until now, i have done the following things:

1. I have created three appwidgetproviderinfo in xml file for small, medium and large app widget
2. have created three layouts for small, medium and large app widget, with the same components. These three layouts differ only in height and width.
3. have created three app widget provider class.
4. have defined these receivers in manifest file.
5. have created one configuration activiy.

Now, according to the developers guide, when an App Widget uses a configuration Activity, it is the responsibility of the Activity to update the App Widget when configuration is complete. We can do so by requesting an update directly from the AppWidgetManager. How can a configuration activity identify whethere the app widget provider is small, medium or large ?? How can it update the multi size app widget ?

4

1 回答 1

0

Since i got no help, i tried to work around. I was unable to create a base class. So, I worked around and created a simpler solution. I create on UpdateWidgetService class. I create only one layout for all the three widgets. I defined its size in appwidgetproviderinfo.xml file. I created three recivers and called the service from all these three recievers. The service handles all the update now.

于 2012-12-02T09:16:51.983 回答