https://bugzilla.novell.com/show_bug.cgi?id=634711
https://bugzilla.novell.com/show_bug.cgi?id=634711#c0 Summary: Updating the UI from a thread not working Classification: Mono Product: MonoDroid Version: unspecified Platform: Other OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: Runtime AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- Description of Problem: I've tried several ways of updating the UI from a thread but none of them work. Steps to reproduce the problem: 1. I have a simple application with a textview as contentview and a menu item When I press the menu I execute: (new System.Threading.Thread(tst.DoWork)).Start(); where tst is an object created inside OnCreate() the tst object has an Android.OS.Handler member and a TextView initialized in the constructor 2. Inside the DoWork method I have handler.Post(new UpdateUI(tv, "Work started")); System.Threading.Thread.Sleep(5000); handler.Post(new UpdateUI(tv, "Work completed")); where public class UpdateUI : Java.Lang.Thread { TextView tv; string upd; public UpdateUI(TextView tv, string text) { this.tv = tv; this.upd = text; } public override void Run() { tv.Text = tv.Text + "\r\n" + upd; tv.Invalidate(); } } I've chosen Java.Lang.Thread because it's derived from IRunnable and there is no Runnable class. Maybe this is not the right way to update the UI but nothing that I've tried works. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
