addDomainDialog.show(supportFragmentManager, resources.getString(R.string.add_domain))
}
- // Get a handle for the activity.
- val activity: Activity = this
-
// Control what the navigation bar back button does.
val onBackPressedCallback: OnBackPressedCallback = object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
undoDeleteSnackbar!!.dismiss()
} else {
// Go home.
- NavUtils.navigateUpFromSameTask(activity)
+ finish()
}
} else if (closeOnBack) { // Go directly back to the main WebView activity because the domains activity was launched from the options menu.
// Save the current domain settings.
saveDomainSettings(coordinatorLayout)
// Go home.
- NavUtils.navigateUpFromSameTask(activity)
+ finish()
} else if (findViewById<View?>(R.id.domain_settings_scrollview) != null) { // The device is in single-paned mode and domain settings fragment is displayed.
// Save the current domain settings.
saveDomainSettings(coordinatorLayout)
undoDeleteSnackbar!!.dismiss()
} else {
// Go home.
- NavUtils.navigateUpFromSameTask(activity)
+ finish()
}
}
}
undoDeleteSnackbar!!.dismiss()
} else {
// Go home.
- NavUtils.navigateUpFromSameTask(this)
+ finish()
}
} else if (closeOnBack) { // Go directly back to the main WebView activity because the domains activity was launched from the options menu.
// Save the current domain settings.
saveDomainSettings(coordinatorLayout)
// Go home.
- NavUtils.navigateUpFromSameTask(this)
+ finish()
} else if (findViewById<View?>(R.id.domain_settings_scrollview) != null) { // The device is in single-paned mode and the domain settings fragment is displayed.
// Save the current domain settings.
saveDomainSettings(coordinatorLayout)
undoDeleteSnackbar!!.dismiss()
} else {
// Go home.
- NavUtils.navigateUpFromSameTask(this)
+ finish()
}
}
}