Confusing results... I have 5 progressBars in an activity working fine.
But after some time the UI almost grinds to a halt.
How can I be sure my 5 progressBar's handlers exit on completion after reaching the progressBars MAX?
Below is an example of one of the Progressbars in my activity.
public void doProgressBarA() {
maskBar4 = (progBar) child2.findViewById(R.id.fragmentB_progressBar4);
new Thread(new Runnable() {//Start long running op in background thread
public void run() {
final SharedPreferences nnn = getSharedPreferences("com.blagmyname.app", MODE_PRIVATE);
int spRateValue = nnn.getInt("current_name_number", 0);
while (m4progressStatus < spRateValue) {
m4progressStatus += 3;
// Update the progress bar and display the current value in the text view
mask4handler.post(new Runnable() {
public void run() {
maskBar4.setProgress(m4progressStatus);
}
});
try { // Sleep for 20 ms to display the progress slowly
Thread.sleep(8);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}).start();
}
////////////////////////////////////////////////////////////////////////////