# Back button pressed does not work if used in code

**URL:** <https://community.thunkable.com/t/back-button-pressed-does-not-work-if-used-in-code/1315571>\
**Category:** Questions about Thunkable X\
**Created:** [May 29, 2021, 3:49pm UTC](https://community.thunkable.com/t/back-button-pressed-does-not-work-if-used-in-code/1315571 "2021-05-29T15:49:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [May 29, 2021, 3:49pm UTC](https://community.thunkable.com/t/back-button-pressed-does-not-work-if-used-in-code/1315571/1 "2021-05-29T15:49:07Z")

</div>

I’m making a music player app, and I really wanted the app to work offline, but even though the sound was playing, the timer that I was using for the ‘elapsed timer’ slider didn’t work offline. So basically, I listened to music within the app for 7 seconds, then went to a different app. The sound would still continue playing, but when I entered the app again, it would still show 7 seconds, then 8. So, I decided to stop the music when Back Button Pressed. When I pressed the back button during Live Test, the sound paused but it didn’t close the app/go to the previous screen. What can I do to work around this? I need to either keep the slider running while in a different app or both close the app _and_ pause the music when the back button is pressed. Also, lots of people like me press the home button instead of the back button, and I noticed that the Back Button Pressed code doesn’t work when I press the home button. Any ideas on making at least one thing work?

Thanks

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:22pm UTC](https://community.thunkable.com/t/back-button-pressed-does-not-work-if-used-in-code/1315571/2 "2024-11-08T13:22:15Z")

</div>


