I have to stop my application after click the stop button. After some time Application class stating background. In application class i am staring multiple services (Each server again have thread to stat work).
Once user press the stop button i have to stop all services and stop the app. Three couple of way i tried but still after some time Application class calling.
MainActivity
1.stop button press ->finish() and tried finishAffinity(); 2. onDestopy -> system.exit ()