In Android, Urho needs to know about some specific events and be able to respond to them accordingly. We also need to add an internal message using MessagingCenter so that we can react to the OnResume event later on in the app. We will get to that when we add the code to initialize ARCore. But for now, add the five required overrides for Android events, as follows:
- In the Android project, open MainActivity.cs.
- Add the five overrides from the following code anywhere in the MainActivity class and the unresolved references by adding using statements for Urho.Droid and Xamarin.Forms, as shown in the following code block:
protected override void OnResume()
{
base.OnResume();
UrhoSurface.OnResume();
MessagingCenter.Send(this, "OnResume");
}
protected override void OnPause()
{
UrhoSurface.OnPause();
base.OnPause();
}
protected override void OnDestroy()
{
UrhoSurface.OnDestroy();
base.OnDestroy...