Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ThreadDemo : Activity
- {
- TextView textview;
- protected override void OnCreate (Bundle bundle)
- {
- base.OnCreate (bundle);
- // Create a new TextView and set it as our view
- textview = new TextView (this);
- textview.Text = "Working..";
- SetContentView (textview);
- ThreadPool.QueueUserWorkItem (o => SlowMethod ());
- }
- private void SlowMethod ()
- {
- Thread.Sleep (5000);
- RunOnUiThread (() => textview.Text = "Method Complete");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement