[android-beginners] Re: android service repaint

2009-09-29 Thread lei

Thanks Mark, this app only has one view, and many custom UI components
which is about to draw on screen. A UI component has properties like
x,y,width,height and so on. The events and actions that are produced
by UI components are placed into event thread. This thread will
response to execute each one sequentially, I call postInvalidate()
after each execution to update screen, but sometimes I just found
postInvalidate() did not paint immediately. I port this app from
JavaME to Android, the serviceRepaint() is called after each repaint
in JavaME, so it can force any pending repaint requests to be serviced
immediately, is there any thing similar for Android or alternative way
to do that?

On Sep 28, 12:56 pm, Mark Murphy mmur...@commonsware.com wrote:
 lei wrote:
  I just found postInvalidate() does not paint the view immediately, is
  there a method like serviceRepaint() in J2ME ?

 Nothing paints anything immediately in Android.

 All GUI events (e.g., setting the text on a TextView) are put on a
 message queue. Those events are only then processed when you return from
 whatever callback you are in and let the UI thread go back to processing
 those events on the queue.

 If you explain a bit more about what effect you are trying to achieve,
 we may be able to give you more guidance.

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

 _Beginning Android_ from Apress Now Available!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Beginners group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: android service repaint

2009-09-28 Thread Mark Murphy

lei wrote:
 I just found postInvalidate() does not paint the view immediately, is
 there a method like serviceRepaint() in J2ME ?

Nothing paints anything immediately in Android.

All GUI events (e.g., setting the text on a TextView) are put on a
message queue. Those events are only then processed when you return from
whatever callback you are in and let the UI thread go back to processing
those events on the queue.

If you explain a bit more about what effect you are trying to achieve,
we may be able to give you more guidance.

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

_Beginning Android_ from Apress Now Available!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Beginners group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---