1

I've been trying to set-up a ProgressDialog (which somewhat works), but it seems to freeze (the animation of the little wheel thing) after about 2-3 spins. The data does eventually load, and the ProgresssDialog gets dismissed - so, all works fine, other than the fact that it freezes after 2-3 spins.

Here's a snip of the code:

// setting up loader
summaryLoader = ProgressDialog.show(SummaryView.this, "", "Loading summary...", false, true);

// settings up and starting the helper thread that's going to load the summery data
Thread t = new Thread() {
  @Override
  public void run() {
    _populateSummary();
  }
};
t.start();

I'm running this on an Entourage Edge running Android 1.6.

I did read about some issues with 1.6 and the animation freezing, but I thought I'd give this a shot and see if anyone here has some ideas.

xil3
  • 16,305
  • 8
  • 63
  • 97

1 Answers1

0

I think though it runs on a thread it still takes a considerable amount of CPU usage.You can try setting the priority for your thread before you start it and see if it solves your problem though it would have an impact on the execution speed.

 t.setPriority(Thread.MIN_PRIORITY);

Else try using a Async task

Android ASync task ProgressDialog isn't showing until background thread finishes

Community
  • 1
  • 1
DeRagan
  • 22,827
  • 6
  • 41
  • 50
  • I tried the priority, but it made no difference. Will take a look at ASync. – xil3 Dec 01 '10 at 13:33
  • ok...Hope you are setting the priority before starting the thread. – DeRagan Dec 01 '10 at 13:35
  • 1
    I think I found the problem! After it finishes processing the child thread, the handler posts a message with some data - it then took the data and attempted to parse it using Html.fromHtml (on the main thread), so apparently the Html.fromHtml has been slowing things down. – xil3 Dec 01 '10 at 13:42