The widget stack removes and adds views dynamically Android 3.0

Can someone give me an example of using the Stack widget and the ability to delete and add views dynamically.

Here is an example.

1) Download the widget and add 4 views to the widget 2) The user downloads and performs actions in one widget package and uses the button to delete one of the 4 views.

I need an example of how to do this.

Thanks for the help!

+3
source share
1 answer

The widget StackViewmust have an implementation of an interface RemoteViewsService.RemoteViewsFactorythat includes a method onDataSetChanged(). As part of this method, you need to update the widget from the data source.

, , , , :

AppWidgetManager awm = AppWidgetManager.getInstance(getActivity()); awm.notifyAppWidgetViewDataChanged(awm.getAppWidgetIds( _ (getActivity(), Your_App_Widget_Provider.class)), R.id.your_stack_view);

+3

All Articles