Grid in full screen disappears.

Hi All
I am trying to develop a widget which has following feature.
1) I have full screen view in which I display small image thumbnails with their names and sizes using grid . I have implemented Pager utility to populate the data in grid and its working fine. This screen is called My Media screen.
2) After selecting any thumbnail from grid it takes the user to another full screen view for slide show.
3) In slide show I am displaying the selected image in larger size. User can go back on My Media and launch slide show screen again. And it works perfectly fine when user moves from My Media screen to slide show screen and reverse in quick successions.
4)But If user stays in slide show view for more than 5 minutes and goes back to My Media screen, the grid of small thumbnails disappears. But the tab strip at top of this screen and logo images used on this screen remains as it is.
5) In console log I have observed that "gc.findViewCandidates()" and "gc.collectViews()" is getting fired for same full screen view.

So is that grid becoming empty because of garbage collection? Any idea how to prevent it?

I am working on framework version - 1.3 and wdk - 1.0.0

Thanks for any help.

4 Replies
  • We have seen this as well. It is caused by moving from one fullscreen view to another that is memory intensive.

    Try these few things based on your scenario.
    1. Put your grid in a custom Container and your slideshow element in another Container
    2. Remove your second view by having both these Containers available in the same view
    3. Control them by diving into a stop command in the Container and toggling the "visible" attribute

    Hope this helps. Post up some demo code if you need further help. :)
  • Thanks Austin and WidgetRealm,

    Meanwhile I have implemented a workaround.
    Whenever view gets garbage collected a "destroyView" method gets called. I have set a flag in destroyView method for full screen. Every time user launch this full screen I am checking this flag. And if true (means view has been gc) I am calling web service once again to bring data and populate the grid again.

    I will try the suggestion given by WidgetRealm.
    Thanks again.
  • NIlesh - any luck with this?
  • Any view can be gc'd if it is not being used.

    Some things to consider/investigate:
    1. are there any JS errors?
    2. when do you populate the grid?
    3. where do the parameters for populating the grid come from?.
    4. do you under any conditions clear the grid or discard the parameters required to rebuild the grid?
    5. Are these parameters available to the view once it is re-initialized by the dock after being gc'd?
    6. Have you considered putting everything in the same view? e.g.: one view that contains one fullscreen frame for your
    thumbnails, another fullscreen frame for your large image. There are various benefits to it.

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets