Shekhar Jadhav
Shekhar Jadhav

Reputation: 1035

How to automatically reload a screen(form) after a given period of inactivity in codenameone

How can I automatically reload a screen(form), if there have been no activity on the page for a given period of time? in codenameone

Upvotes: 2

Views: 62

Answers (1)

Chen
Chen

Reputation: 3760

UITimer can be used to schedule tasks.

    UITimer timer = new UITimer(new Runnable() {

        @Override
        public void run() {
        ...
        }
    });
    timer.schedule(1000, false, Display.getInstance().getCurrent());

Upvotes: 2

Related Questions