The application has a button called EXIT that lets you go to the home screen. When this button is pressed, I want to have a screen showing the application icon on my phone, what should I do?
android exit back-button
Android does not recommend that users choose to exit the application. Those things are managed by the OS. However, you can import the home screen using Intent.
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
© 2024 OneMinuteCode. All rights reserved.