Hi all,

i'm kinda confused by the ActivityIndicator Class. Is the
ActivityIndicator.setActive() invoked by
ButtonPressListener.buttonPressed(Button button) directly or indirectly will
not become effective until the PushButton is released?

Here is my question, I have one PushButton to start a computing task, as the
computing task might run for pretty long time, I need to use
ActivityIndicator to let people who started the computing task by pressing
the PushButton know that the task is still running in the background and
everything is all right, so i have some code like below:

ActivityIndicator activityIndicator =
(ActivityIndicator)namespace.get("activityIndicator");
PushButton pushButton = (PushButton)namespace.get("pushButton");
pushButton.getButtonPressListeners().add(new ButtonPressListener() {
        @Override
        public void buttonPressed(Button button) {
                activityIndicator.setActive(true);
                startComputingTask();
                activityIndicator.setActive(false);
        }
}

Code above doesn't work, the activityIndicator never becomes "active", then
i moved "activityIndicator.setActive(true);" to the first line in the
function body of startComputingTask(), and moved
"activityIndicator.setActive(false);" to the last line in the function body
of startComputingTask(), it doesn't work either...

i'v no idea about how to use the ActivityIndicator to solve my problem.
Anyone can help me? Thanks a lot!

Reply via email to