On my app I would like to close the app when reaching the mainActivity. At the moment I have noHistory added to all activities in the manifest because I am overriding the navigation based on how I would like the app to flow.
What code would I put into the onBackPressed function to close the app?
The issue I have is that I do not want to use noHistory because when moving between apps or minimizing the app, the app will load from the splash screen again when you open it which is not helpful for navigation
NOTE: I have a splash screen implemented as well.