PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → progressbar and threads? example needed
progressbar and threads? example needed
Débuté par KJVA, 15 juil. 2015 13:01 - Aucune réponse
Posté le 15 juillet 2015 - 13:01
In my android app I want to show an infinite progressbar when someone pushes a button to upload files.
Now I have the upload functionality in a secondary thread, but this stops the mainthread and thus the animation of the progressbar.
Click BTN_VerstuurMelding
{
PROGBAR_PROGRESS_LinearNative..Visible = True

ThreadExecute("verstMeld",threadNormal,"VerstuurMeldingen")
ThreadWait("verstMeld",Infinite)

PROGBAR_PROGRESS_LinearNative..Visible = False
}


and if I want to show the progressbar in a secondary thread. It gives the error: "Only the original thread that created a view hierarchy can touch its views":
Click BTN_VerstuurMelding
{
ThreadExecute("progressbar",threadNormal,"ShowProgressbar")
}

Procedure ShowProgressbar()
IF(PROGBAR_PROGRESS_LinearNative.. Visible) THEN
PROGBAR_PROGRESS_LinearNative..Visible = False
ELSE
PROGBAR_PROGRESS_LinearNative..Visible = True
END


Can someone provide an example that shows how I can show an animating progressbar during the execution of a secondary thread?