Skip to content

Instantly share code, notes, and snippets.

@BrunoVT1992
Created June 23, 2016 10:56
Show Gist options
  • Save BrunoVT1992/27c5123e6f12f4dead84dd94a93e9290 to your computer and use it in GitHub Desktop.
Save BrunoVT1992/27c5123e6f12f4dead84dd94a93e9290 to your computer and use it in GitHub Desktop.
Extension to see if a thread is the main(UI) thread for Xamarin Android.
using Android.OS;
using Java.Lang;
namespace Droid
{
public static class ThreadUtil
{
public static bool IsMainThread(this Thread currentThread)
{
return currentThread == Looper.MainLooper.Thread;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment