madcoder wrote: > Later, in another method in the same activity and thread, I try to > change the color once again: > > redButton.setBackgroundColor(Color.BLACK); > > next, I tell it to draw again: > > redButton.invalidate(); > > finally I introduce a delay to let the UI update and allow the user to > see the color change:
UI updates do not occur if your code is running. Only when you exit the Activity callback method (e.g., onResume()) or otherwise relinquish the UI thread will UI updates be processed. Calling methods like setBackgroundColor() merely put a UI event on the event queue, which the UI thread will actually process as soon as you let go of the UI thread. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.4 Published! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" 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-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

