if (application.android) { application.android.on(application.AndroidApplication.activityBackPressedEvent, function() { // commit or dispatch stop player ); }