Created
June 23, 2016 10:56
-
-
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.
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