Xamarin forums question link: https://forums.xamarin.com/discussion/60321/disabling-multitouch-across-the-appwide-in-android-xamarin#latest
Is there a way to disable multi-touch App wide in Xamarin Android. I currently have a PCL, project. With shared code implemented using Xamarin forms UI.
I just want to prevent users from clicking more than 1 button in Android.
All our buttons are ICommand based and called from the viewModel. They are all async Tasks (we wanted to make them non-blocking and run in the background thread). --> This approach works fine in iOS, just want to disable it App wide in Android.
I tried the following in MainActivity.cs
public override bool OnTouchEvent(MotionEvent e)
{
if(e.PointerCount > 1)
{
return false;
}
else
{
return base.OnTouchEvent(e);
}
}
But it has not made any difference. Any help would be appreciated
public override void OnUserInteraction()
{
base.OnUserInteraction();
}
works but does not give me the number of touch events