Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (process)
Viewing all articles
Browse latest Browse all 20

How can ActivityIndicator run some functions and the close?

$
0
0

HI,

I'm trying to create an activity indicator that executes some functions in the background and then closes automatically. The problem I face is that the activity indicator closes before completion because the functions are called asynchronously. When the window activity indicator opens and completes the layout process then is being executed the function with all the sub functions included there. pActivityIndicator.addEventListener('postlayout', executeProcess);

//background processes
function executeProcess() {
   function call1() {
       //do a process
       //call another function here...
       call3();
   }
   function call2() {
       //do something 2
       call4();
   }
 
   call1();
   call2();
   pActivityIndicator.close();
}

Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>