Sir, i think you need to describe you question in detail so other member can understand your problem.
according to your problem description that behavior is absolutely correct because you subscribe backbutton event and write exitapp code within subscription. we don’t know in which page you write that code (i mean in app.component or other page) so one can can help with your problem until they understand full use case.
no one can understand what is your issue and what you want to do so i suggest you to give more detail of your problem.
I wrote it on the home.page.ts code. This code still works when you go to any page from the homepage. I want this code to don’t run on another page from the homepage
probably home page is not good place to configure back button event
i don’t know you search in forum for it but may be this link help you how to configure it in best way