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

Actually there is no difference if you have only one activity. However, if you have several activities on the stack, then:

finish() - finishes the activity where it is called from and you see the previous activity.

System.exit(0) - restarts the app with one fewer activity on the stack. So, if you called ActivityB from ActivityA, and System.exit(0) is called in ActivityB, then the application will be killed and started immediately with only one activity ActivityA

Popular posts from this blog

Menampilkan tanggal fastreport delphi

Android C2DM (Cloud to Device Message) adalah

Menambahkan data pada TreeView delphi dari database mysql