locked
App crashes when screen orientation changed to portrait mode when UI hangs

    Question

  • Hi,

    My app is getting crashed when screen orientation is changed from landscape to portrait mode in RT device during the time when my app ui has frozen. The app doesn't crash when screen orientation is changed when the app is working fine. However due to some reason, I can't resolve the ui getting frozen. Please let me know the solution for that. I tried with another sample app, and it behaves the same as above.

    Thanks,

    Suhas

    Monday, September 15, 2014 9:46 AM

Answers

  • Hi Suhas,

    When app screen orientation changes to portrait mode, it triggers SizeChanged event handler. In that method, app need to call VisualStateManger.GoToState method to change the UI. I think your app crashes in this step when its UI is blocking. Go to DEBUG->Exceptions... and select Thrown for Common Language Runtime Exceptions. You may get some more information why or how app crashes.

    Another question is it’s not recommend to block the UI thread in windows store app. In Performance best practices for windows store app, it suggests us to keep the UI thread responsive. And as you can see many windows runtime features are exposed as asynchronous APIs. So can you tell me the reason you must block the UI thread?

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, September 17, 2014 9:35 AM
    Moderator

All replies

  • I had observed the same issue in my app. But couldn't find a concrete solution to it.
    Monday, September 15, 2014 9:57 AM
  • Hi Suhas,

    When app screen orientation changes to portrait mode, it triggers SizeChanged event handler. In that method, app need to call VisualStateManger.GoToState method to change the UI. I think your app crashes in this step when its UI is blocking. Go to DEBUG->Exceptions... and select Thrown for Common Language Runtime Exceptions. You may get some more information why or how app crashes.

    Another question is it’s not recommend to block the UI thread in windows store app. In Performance best practices for windows store app, it suggests us to keep the UI thread responsive. And as you can see many windows runtime features are exposed as asynchronous APIs. So can you tell me the reason you must block the UI thread?

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, September 17, 2014 9:35 AM
    Moderator