In an app written with jetpack compose, I finish the app with the following instructions:
val activity = (LocalContext.current as? Activity)
activity?.finish()
exitProcess(0)
In the Android Studio emulator, the app closes but when you click on the square button, the image of the app appears. If I select it, it starts again.
How to close the app so that it disappears completely?
CodePudding user response:
You can use this to close the application:
finishAndRemoveTask();