diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-09-20 18:08:58 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-09-20 18:08:58 +0200 |
commit | 5fd1a32ae419cb064da91bd48391a1837ad969e9 (patch) | |
tree | 211bf488626e62d156840732882b6023759574f6 /ui/src/main/java | |
parent | 655a8538578c7e7a0979ff64ee87433f920a699f (diff) |
TunnelEditorFragment: do not assume a context
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java')
-rw-r--r-- | ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt b/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt index 26349211..e035210a 100644 --- a/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt +++ b/ui/src/main/java/com/wireguard/android/fragment/TunnelEditorFragment.kt @@ -48,7 +48,7 @@ class TunnelEditorFragment : BaseFragment() { if (throwable == null) { message = getString(R.string.config_save_success, savedTunnel.name) Log.d(TAG, message) - Toast.makeText(requireContext(), message, Toast.LENGTH_SHORT).show() + Toast.makeText(activity ?: Application.get(), message, Toast.LENGTH_SHORT).show() onFinished() } else { val error = ErrorMessages[throwable] @@ -214,7 +214,7 @@ class TunnelEditorFragment : BaseFragment() { tunnel = newTunnel message = getString(R.string.tunnel_create_success, tunnel!!.name) Log.d(TAG, message) - Toast.makeText(requireContext(), message, Toast.LENGTH_SHORT).show() + Toast.makeText(activity ?: Application.get(), message, Toast.LENGTH_SHORT).show() onFinished() } else { val error = ErrorMessages[throwable] |