public void generateNumbers(){
progressBar.setVisibility(View.VISIBLE);
while(){
//approximately 5 second long procedure
}
printNumbers();
progressBar.setVisibility(View.GONE);
}
I want that the progress bar is visible when this long procedure in while loop is running and then dissapear. The code like this shown progressBar after the loop is finished and then also dissapear (setVisiblity(GONE)).
In while loop i don't have any new threads or AsyncTask