Android :: Background Thread across the Application
<p>i want to detect the audio headphone to play the audio file. but i need to detect that earphone is connected or not  everytime in each tab like album, aritist, playlist, etc. i  when i am trying to do it. i am creating separate asynctask to detect the device in each tab. its working fine. but if i am giving more stress to the application like changing over the tabs fastly. My App's GUI i getting freezed. i think its beacuse of running more thread or thread pool got dumpped.</p>

<p>So i have an other idea that only one background thread will run to check the device connectivity and funtions. we need to share the status to everywhere in the app. but i have no idea to how to implement it. </p>

<p>Any Idea or sample codes on this? Thanks in advance.</p>

<p>Check <a href="http://stackoverflow.com/questions/11646113/android-ui-changes-from-shared-background-thread">this Post</a> Also. </p>
