You do it by learning how to program in App Inventor Ganesh.
What you want to do is discussed here
but not specifically.
Try some blocks, if you are unsuccessful, show us what you tried and someone will provide specific advice.
We want you to have fun with App Inventor and learn to program. Perhaps before you finish your back button exercise, you should start reading and use some resources to help you learn to use the AI2 tools A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
Do some tutorials, then start building your project. If you show us what you have done by providing an image of your blocks here, someone will give you specific advice.
Regards,
Steve