Skip to content

Commit deb361a

Browse files
committed
update README
1 parent 32b7962 commit deb361a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ Please, have a look at the **example** project.
88

99
**WidgetBuilder**
1010

11-
There is an interface `WidgetBuilder`, which has only one method `update(Context context, Bundle dataBundle, int... ids)`, that called in `UpdateService`, that contains WidgetUpdateLibrary.
11+
There is an interface `WidgetUpdater`, which has only one method `update(Context context, Bundle dataBundle, int... ids)`.
1212

13-
Need to implement that interface.
1413
```java
1514
public class SingleUpdater implements WidgetUpdater {
1615
@Override
@@ -28,15 +27,16 @@ public class SingleUpdater implements WidgetUpdater {
2827

2928
**WidgetProvider**
3029

31-
Make an annotation `RemoteViewsUpdater` on `android.appwidget.AppWidgetProvider` with class that implements `WidgetBuilder`.
30+
When creating your own widget you can use `RemoteViewsUpdater` annotation to link the `WidgetUpdater`'s child with your `android.appwidget.AppWidgetProvider` as below.
31+
`WidgetUpdateService` is an `android.app.IntentService` which will invokes your `WidgetUpdater` by calling method `updateWidgets(Context context, AppWidgetsProvider provider, Bundle dataBundle, int... ids)`.
3232

3333
```java
3434
@RemoteViewsUpdater(SingleUpdater.class)
3535
public class ExampleSingleAppWidget extends AppWidgetProvider {
3636
@Override
3737
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
3838
// update widgets
39-
UpdateService.updateWidgets(context, this, bundle, appWidgetIds);
39+
WidgetUpdateService.updateWidgets(context, this, bundle, appWidgetIds);
4040
}
4141

4242
@Override
@@ -49,7 +49,7 @@ public class ExampleSingleAppWidget extends AppWidgetProvider {
4949
Bundle bundle = new Bundle();
5050
//...
5151
// update widgets
52-
UpdateService.updateWidgets(context, this, bundle, widgetIds);
52+
WidgetUpdateService.updateWidgets(context, this, bundle, widgetIds);
5353
}
5454

5555
@Override

0 commit comments

Comments
 (0)