{"id":6438,"date":"2014-04-18T05:22:37","date_gmt":"2014-04-18T05:22:37","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/how-to-handle-error-when-two-apps-are-using-backgroundaudioplayer-collection-of-common-programming-errors\/"},"modified":"2014-04-18T05:22:37","modified_gmt":"2014-04-18T05:22:37","slug":"how-to-handle-error-when-two-apps-are-using-backgroundaudioplayer-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/how-to-handle-error-when-two-apps-are-using-backgroundaudioplayer-collection-of-common-programming-errors\/","title":{"rendered":"How to handle error when two apps are using BackgroundAudioPlayer-Collection of common programming errors"},"content":{"rendered":"<p>This is another background audio resources are no longer available error in Windows Phone 7, but a different scenario. I have 2 apps, which both use <code>BackgroundAudioPlayer<\/code> to play background music.<\/p>\n<p>When app A is playing background music, I press Home button to choose app B, play some music in app B, then return to app A.<\/p>\n<p>There whenever app A use <code>BackgroundAudioPlayer.Instance<\/code>, it will throw <code>InvalidOperationException<\/code> with message &#8220;<em>background audio resources are no longer available<\/em>&#8220;.<\/p>\n<p>The only thing I can do is <code>try\/catch<\/code>, which is of no use other than preventing the app to crash. And, I cannot call <code>BackgroundAudioPlayer.Instance.Close()<\/code> because it is no longer available.<\/p>\n<p>How to deal with this ?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is another background audio resources are no longer available error in Windows Phone 7, but a different scenario. I have 2 apps, which both use BackgroundAudioPlayer to play background music. When app A is playing background music, I press Home button to choose app B, play some music in app B, then return to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6438","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6438"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6438\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}