Search code examples
listviewqmlblackberry-10blackberry-cascades

Update listview when coming back to app from background in blackberry cascades using qml


in my homepage I have a listview that display some data and refreshes the data and it works fine. What I need to do is to refresh this list when I come back to the app after going out. I have already written the code for refresh in my function called reloadView(), I just need to know if there is any method in qml that detects when the app come backs to foreground where I can call this reloadView(), if not is there any other way to achieve this?

 This is my homepage.qml structure


Page {
    //some code
    function reloadView()
    {
        //This is the function which I need to call when app comes to foreground
    }
    Container {
        layout: DockLayout {
        }
        ScrollView {
            id: homePageScroll
            Container {
                layout: DockLayout {
                }
                ListView { 
                    //somecode
                }
            }
        }
    }

Solution

  • In Qml, Fullscreen() is signal emitted when the application is restored to fullscreen.

    check this link