hide notification

13 views
Skip to first unread message

howud...@gmail.com

unread,
Oct 15, 2016, 3:41:01 PM10/15/16
to CodenameOne Discussions
I can override onShow or cal addShowListener() in order to know when a form is being displayed.  I use this to start a timer.  I'd like to cancel the timer when the form is not visible (ie user went home, or turned the display off, or selected another form).  How can I do this?

Shai Almog

unread,
Oct 15, 2016, 10:47:24 PM10/15/16
to CodenameOne Discussions, howud...@gmail.com
If you use UITimer it will not invoke if the form is hidden. However it will keep counting down so it might invoke immediately if the form is shown.

howud...@gmail.com

unread,
Oct 15, 2016, 10:55:07 PM10/15/16
to CodenameOne Discussions, howud...@gmail.com
I will look into UITimer.  What I have done for now is in showListener I create a timer.  In the timer event i check if (Display.getInstance().getCurrent() != this) and kill the timer.  That seems to work so far.
Reply all
Reply to author
Forward
0 new messages