I have created app that will send audio streaming to server when user click on start button.For that i created a socket thread to send audio to server.And it stop after pressing the stop button.It works perfect,But the problem is that when i start streaming and navigate from current activity to different activity by pressing the back button or from action bar menu and come on home screen to stop the streaming am not able to stop the streaming.It means the thread is running at background.
So my question is how can i stop that thread or streaming.