Forum Libraries, Components, and Plugins


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

UrhoSharp in Xamarin Android : UrhoSurface destroy blocks UI thread and creates ANR

I am using Urhosharp for animation in my project. I am creating UrhoSurface on button click and destroying it on button back pressed by calling Finish on the activity. It works fine for 5-6 times and after that it doesn't respond to onDestroy. I get to the point where log prints surfaceDestroyed() but nativesurfaceDestroyed doesn't get called . It blocks the UI thread that results in ANR.

// Called when we lose the surface
public void surfaceDestroyed(SurfaceHolder holder) {
Log.v("SDL", "surfaceDestroyed()"); // this gets called
// Call this before setting mIsSurfaceReady to 'false'
SDLActivity.mIsSurfaceReady = false;
SDLActivity.onNativeSurfaceDestroyed();// no response here

Sign In or Register to comment.