What happens when all activities of an application finishes?

前端 未结 4 1533
南方客
南方客 2020-12-28 08:24

Scenario:

I\'ve four activities in my Android Application, lets say A, B, C and D. There is one Constants.java class in the app which extends App

4条回答
  •  悲哀的现实
    2020-12-28 09:01

    Android will keep the process until it needs to reclaim the process memory. That way, if the user immediately returns to your application, your application will appear quicker.

    The value will persist until the application is killed.

    Should not using System.exit(10) followed by Process.killProcess(Process.myPid()) for exiting the application?

    You should really think about not exiting the application. This is not how Android apps usually work.

提交回复
热议问题