using Android.OS;
public class MyThread
{
public void Run()
{
RunOnUiThread(() => DoSomething());
}
private void RunOnUiThread(Action action)
{
using (var handler = new Handler(Looper.MainLooper))
{
handler.Post(action);
}
}
}
Showing posts with label xamarin. Show all posts
Showing posts with label xamarin. Show all posts
Tuesday, January 10, 2017
[HowTo] Call any code on UI thread outside of Activity
Labels:
xamarin
Subscribe to:
Posts (Atom)