Added callback functions for the back button and the menu button on android.