You need to run your login() function in a seperate thread so the UI thread can update the UI (and show you its text)
-niko On May 22, 9:25 am, Robin van Leeuwen <[email protected]> wrote: > I have a problem with showing text on the screen before an action is > taken. I have a function "login()" which takes quite a while, and i > want > to display the string "Loggin in..." before this function starts doing > it's > work. > > The problem is that the text "Logging in..." is not displayed until > the > login() function finishes. And so only "Done..." is displayed. > > ----CODE---- > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > > TextView statusbar = (TextView) findViewById(R.id.statusbar); > > statusbar.setText("Logging in..."); > login(); > statusbar.setText("Done..."); > } > > How can I flush the IO so the "Logging in..." string is displayed > before the login() function starts doing it's work? > > -- > 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 > athttp://groups.google.com/group/android-developers?hl=en -- 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

