How to update textView from a Thread?

srensren DKMember

Hey

I need a way to update some text in a textView each X second, is there another way to do this then threads? and if threads is the only way, could anyone give an example on it?

Thanks in advance.

Posts

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    Use RunOnUiThread to update controls from a thread.

  • srensren DKMember

    Can you give any monodorid examples? cause I've seen some java examples on it and that didn't make any sense for me :(

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    There's a simple example in the docs on this topic.

  • srensren DKMember

    Thanks ill take a look

  • srensren DKMember

    seems easy enough, thank you so much :), you know if ill be able to use RunOnUIThread in a Fragment?

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    Sure, just use Fragment.Activity.RunOnUiThread().

  • srensren DKMember

    NICE!!!^^(found it), do i just create a timer then to run the Fragment.Activity.RunOnUiThread() each X second?

  • ChrisHonselaarChrisHonselaar NLBeta ✭✭✭

    Great :) And yes, using a Timer seems appropriate.

Sign In or Register to comment.