I Found some codes for quit an Android application programatically. By calling any one of the following code in onDestroy() will it quit application entirely?
You had better use finish() if you are in Activity, or getActivity().finish() if you are in the Fragment.
finish()
Activity
getActivity().finish()
Fragment
If you want to quit the app completely, then use:
getActivity().finish(); System.exit(0);