Difference between finish() and System.exit(0)

后端 未结 4 1475
醉话见心
醉话见心 2020-11-28 11:46

I\'m talking about programming in android.

In early days I thought that, finish() closes current activity and go back to the previous

4条回答
  •  孤城傲影
    2020-11-28 12:25

    According to android Developer -

    finish()

    Call this when your activity is done and should be closed. The ActivityResult is propagated back to whoever launched you via onActivityResult().

    System.exit(0)

    The VM stops further execution and program will exit.

提交回复
热议问题