How to create a class which update your App Widget?

Create a your own AppWidget Provider by extending AppWidgetProvider class.

http://developer.android.com/reference/android/appwidget/AppWidgetProvider.html

Then, What is AppWidgetProvider class?

AppWidgetProvider is a convenience class to aid in implementing an AppWidget provider. Everything you can do with AppWidgetProvider, you can do with a regular BroadcastReceiver. AppWidgetProvider merely parses the relevant fields out of the Intent that is received in onReceive(Context,Intent), and calls hook methods with the received extras.

It provides onUpdate() and several other methods for easy management of your App Widget.

public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)

+sk.26.08

Advertisements

Published by