Fix issue where API23 became required by mistake
authorJason Smith <jason.smith@xamarin.com>
Thu, 7 Apr 2016 04:17:06 +0000 (21:17 -0700)
committerJason Smith <jason.smith@xamarin.com>
Thu, 7 Apr 2016 04:17:06 +0000 (21:17 -0700)
Xamarin.Forms.Platform.Android/Forms.cs

index 65bfbc4..a089ea9 100644 (file)
@@ -362,7 +362,15 @@ namespace Xamarin.Forms
                                return new _IsolatedStorageFile(IsolatedStorageFile.GetUserStoreForApplication());
                        }
 
-                       public bool IsInvokeRequired => !Looper.MainLooper.IsCurrentThread;
+                       public bool IsInvokeRequired
+                       {
+                               get
+                               {
+                                       if ((int)Build.VERSION.SdkInt >= 23)
+                                               return !Looper.MainLooper.IsCurrentThread;
+                                       return Looper.MainLooper != Looper.MyLooper();
+                               }
+                       }
 
                        public void OpenUriAction(Uri uri)
                        {