On Tuesday, April 24, 2012 10:58:43 AM UTC-7, Ab wrote: > > Unfortunately my RenderTask varies from about .5seconds - 5 seconds. So, > it is very undesirable to either perform it on the UI thread, or to force > the UI thread to wait on it.
In that case, decide what you want to have happen. If you don't want to draw the bitmap till you are done, don't draw till it is marked as done. Or would you like to see the drawing in progress? Then draw it in stages. Lock, draw a line or two, release. Lock, draw an icon, release. Lock, draw a circle or square, release. I've done some very complicated draws this way. Don't think that you can draw the bitmap while a canvas method is in progress drawing to the bitmap. > Any idea what causes the ImageButton.draw() to hang, its possible the > hanging is preventable/fixable? > I don't see it in the code, but you said that you are using a bitmap in the UI method at the same time you are drawing to said bitmap in another thread, right? You can probably see in the debugger where it is hung and it's probably in a low level canvas or bitmap method. It's definitely preventable/fixable. You just need to plan how. Nathan -- 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

