I have a StackView widget that I can set to scroll through the items automatically using the following xml code:
<app-widget provider> ...
...
android:autoAdvanceViewId="@id/stack_view"
</app-widget provider>
I know if I remove this line it will disable the automatic scrolling. What I would like to do is utilize the shared preferences I set up when the widget is added to the screen to provide an option for the user to enable or disable the automatic scrolling. Is this possible? if so how would I go about making changes to the app-widget provider inside the code?
Thanks!
Unfortunately the
AppWidgetProviderInfo(the object created by this XML) is quite static, and can only change when the APK is upgraded. If you want to implement this feature in a dynamic way, you will need to use the widget’s regular update mechanism to manually advance your view from code.