How and when should I use method getLockScreen()(getAppDrawerScreen() too)?

How and when should I use method getLockScreen()(getAppDrawerScreen() too)? Testing it, but return NullPointerException or ClassCastException error.

I would like to access the LockScreen’s Customview using script. Is not getLockScreen() used for this purpose?

]]>

2 Commentsto How and when should I use method getLockScreen()(getAppDrawerScreen() too)?

  1. Anonymous says:

    < ![CDATA[

    These functions return the live screen in which containers and items are displayed. As a consequence they may not exist at time of calling. Screens are created and destroyed depending on the user navigation and system rules, they are not fixed data. AppDrawer and Lock screen are linked with Android activities.



    There are two screen that are always available: the background screen, and the screen linked in the event. (see getEvent())



    If you wish to access containers and items for any screen (and in particular for a screen which is not displayed) you can use getBackgroundScreen().



    Since the background screen is always available, it will be able to load objects, but with some limitations since objects won’t be displayed on a real screen.


    Use getLockScreen / getAppDrawerScreen when you know these screen are alive.

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Pierre Hébert​


    Thank you for your polite answer.


    It takes time to understand…



    Sorry, I was able to use getAppDrawer().


    I understood that I have to test it when AppDrawer screen is displaying.



    getLockScrern() test:



    1). Create shortcut of run script action to LockScreendesktop.


    Script code is only,


    alert(getLockScreen());



    2). Turn off/on display. Show LL’s LockScreen. And then, start shortcut.



    I think that result is ‘LOCK’ if it is success, but return error.(It’s OK, getEvent().getScreen() return ‘LOCK’)


    Is my test wrong?

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *