I am trying to update textview text several times but only last text is displayed on screen. I basically want to delay text appearance so that user gets time to read the message. Below is the code snippet that i have tried. Kindly guide. I am using xamarin.
class SplashScreen : Activity
{
public SplashScreen()
{
}
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
RequestWindowFeature (Android.Views.WindowFeatures.NoTitle);
SetContentView(Resource.Layout.splash_screen);
MyTextView tv0 = FindViewById<MyTextView> (Resource.Id.BookIntro);
tv0.Text = "START";
ThreadPool.QueueUserWorkItem(d =>
{
//some code here
RunOnUiThread (() => {
tv0.Text = "HI";
System.Threading.Thread.Sleep(2000);
tv0.Text = "HELLO";
System.Threading.Thread.Sleep(2000);
tv0.Text = "HOW ARE YOU";
System.Threading.Thread.Sleep(2000);
tv0.Text = "WELCOME TO ANDROID";
System.Threading.Thread.Sleep(2000);
tv0.Text = "BYE BYE";
});
});
}
}
The above code displayed text "START" and then sleeps for (2+2+2+2 = 8) seconds and then displays only last text (BYE BYE). Kindly guide.