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?
We want code that is robust and simple. This solution works on old devices and newer devices.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { getActivity().finishAffinity(); } else{ getActivity().finish(); System.exit( 0 ); }