Extension to see if a thread is the main(UI) thread for Xamarin Android.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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