Sorry for what I'm sure will turn out to be a very stupid question..
I am using Android UI not Xamarin Forms for the presentation layer in my Xamarin app, but I want to use the Activity.RunOnUIThread (from Android), which all Xamarin docs suggests is Device.BeginInvokeOnMainThread (from the Xamarin.Forms) project. Obviously I don't have this available since I don't have a reference on the xamarin.forms project.
Where do I find the run-on-ui-thread mechanism in Xamarin if I don't want to use Forms?
Android Activity
s have a RunOnUiThread
method that you can use:
RunOnUiThread ( () => {
// manipulate UI controls
});
Ref: https://developer.xamarin.com/api/member/Android.App.Activity.RunOnUiThread/p/Java.Lang.IRunnable/
InvokeOnMainThread (delegate {
// manipulate UI controls
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With