How to create a class which update your App Widget?

Create a your own AppWidget Provider by extending AppWidgetProvider class.

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)



Published by