Skip to content Skip to sidebar Skip to footer

How Do I Access A Viewflipper In A Widget To Populate Its Content Dynamically?

I have a Widget that needs to be populated with dynamic content. Specifically I'd like it to contain a ViewFlipper whose Views are updated at runtime. I'm not clear on how to acces

Solution 1:

Specifically I'd like it to contain a ViewFlipper whose Views are updated at runtime

There are two possible interpretations of this request.

One is that you want the ViewFlipper to hold a fixed number of "pages", and each "page" always has the same widgets, but you want to populate the contents of those widgets. In that case, you populate them the same way that you do anything else in an app widget: by referring to those specific widgets, ignoring the ViewFlipper.

Or, you want a ViewFlipper that has varying number of pages at different times, or where the pages have varying layouts. In that case, you can try addView() for each page, specifying the ViewFlipper id as the first parameter. Or, try AdapterViewFlipper, and see if setRemoteAdapter() will cause the app widget to reload its contents from the RemoteViewsService.

Post a Comment for "How Do I Access A Viewflipper In A Widget To Populate Its Content Dynamically?"