summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xamarin.Forms.Platform.Android/Forms.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.Android/Forms.cs b/Xamarin.Forms.Platform.Android/Forms.cs
index c2dc770..6f3346f 100644
--- a/Xamarin.Forms.Platform.Android/Forms.cs
+++ b/Xamarin.Forms.Platform.Android/Forms.cs
@@ -262,9 +262,16 @@ namespace Xamarin.Forms
double _microSize;
double _smallSize;
+ static Handler s_handler;
+
public void BeginInvokeOnMainThread(Action action)
{
- new Handler(Looper.MainLooper).Post(action);
+ if (s_handler == null || s_handler.Looper != Looper.MainLooper)
+ {
+ s_handler = new Handler(Looper.MainLooper);
+ }
+
+ s_handler.Post(action);
}
public Ticker CreateTicker()