Implementing onBackPressed event and its behavior on GenericFragment and GenericDialog