This example of will allows us to minimize currently running activity and will notify about the activity status on notification bar.
1.) Create a new project by File-> New -> Android Project name it AutoMinimizeDemo.
2.) You will see some default code into your main.xml, strings.xml and android manifest file.
3.) Now add 2 buttons into your main.xml or write following into main.xml file: