Hard to say what you really want from the snippets of information and code you provided. Generally speaking you normally only call setContent() to setup your screen from your activity's onCreate() method, not when some state changes that needs reflection on the UI. When you have state changes you need to find the GUI element that you want to change with findViewById() an call setText() (or whatever) on it directly. It will redraw itself then.
And as Romain said, don't do any sleeps or other long running stuff on the UI thread. This way you will block, which will in turn lead to unresponsiveness, e.g. a press of the menu key or a tap on the screen will not be dispatched until the UI thread is freed up again. Provide a working, simple, short sample just demoing one concept you are trying to understand. And it would be easier to help you. What helped me better understanding this basic concepts was doing the samples. http://developer.android.com/guide/tutorials/notepad/index.html On Thu, May 14, 2009 at 8:37 AM, Sukitha Udugamasooriya <[email protected]>wrote: > > Hi geniuses, > > I have few buttons on the content. When I click on one button, > > 1-- I want to change the text of the button. > 2-- Then I want to change the content view. > > this is my method which executes with the onClick event. > > private void markUser(int index) { > > btnArray[index].setText(mark); > btnArray[index].setClickable(false); > > showGameOverMenu(); // calls the setContentView(); > } > > Here the problem is the text change of the button is not visible. > > How can I make it visible??? I'm not thorough with how the UI thread > works in android > > Thanks in advance > > Sukitha > (wannaB android master ;)) > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

