Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.