locked
exit app by source code without pressing the button RRS feed

  • Question

  • When pressing hardware back button on windows phone, previous page appeared. and press it continually, current app is exited.  what is the state of app after exited? is this not running state?

    anyway, i want to exit app by source code without pressing hardware back button.
    Tuesday, November 25, 2014 4:52 AM

Answers

All replies

  • Hi estmob,

    >>what is the state of app after exited? is this not running state?
    Yes, after exited, the app will become a not running state and the app will be closed.

    For more information, please try to refer to the following article:
    #Windows Phone app lifecycle:
    http://msdn.microsoft.com/en-us/library/windows/apps/ff817008(v=vs.105).aspx#BKMK_TheWindowsPhoneApplicationLifecycle .

    >>i want to exit app by source code without pressing hardware back button.

    If you are using the Windows Phone Silverlight 8/8.1 app, please try to use the following method to exit your app:
    Application.Current.Terminate();
    For more information, please try to check this article:
    http://msdn.microsoft.com/library/windows/apps/system.windows.application.terminate(v=vs.105).aspx .

    If you are using the Windows Phone Runtime 8.1 app, maybe you can try to use the following method to exit your app:
    Application.Current.Exit();

    Note: Use the above method to provide UI that enables users to exit your app. Normally, however, you should not provide this UI because the system automatically manages app lifetime and terminates suspended apps as needed to free resources. .

    For more information, please try to check this article:
    http://msdn.microsoft.com/en-us/library/ie/windows.ui.xaml.application.exit .

    Best Regards,
    Amy Peng


    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.







    Tuesday, November 25, 2014 6:31 AM
  • If you want to exit app by code you can use  

    Application.Current.Terminate();

    • Proposed as answer by sharmi04 Tuesday, November 25, 2014 6:32 AM
    Tuesday, November 25, 2014 6:32 AM