On Wed, Aug 17, 2011 at 12:44 PM, Snowak <[email protected]> wrote:
> I have hundreds of CheckBox widgets in my layout

That is unlikely to be a good idea.

> Obviously such heavy work should be done in separate thread,

Not really.

> The only thing that this thread actually can do is looping through the
> list and posting the Runnable for every found checkbox. The problem is
> that all those Runnables arrive in the UI thread almost at the same
> time, thus they're all executed at once... The application behaves
> exactly like I would run the above code in the UI thread - everything
> freezes. A possible solution is sleeping for some miliseconds after
> each checkbox so the Runnable can be executed and the UI will have
> time to process the events... but it's more like a hack.
>
> How can I solve this problem?

Redesign your UI to not have "hundreds of CheckBox widgets" at once.
Or, update them on the main application thread and hope for the best.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 3.9 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to