From 86941d837d0fd4368b8a1daabece300a3ec1e0e2 Mon Sep 17 00:00:00 2001 From: euxane Date: Wed, 18 Sep 2024 23:41:13 +0200 Subject: activities/basefragment: allow access to parent activity Useful to show error dialogs from fragments. --- app/src/main/java/org/pacien/tincapp/activities/BaseFragment.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/src/main') diff --git a/app/src/main/java/org/pacien/tincapp/activities/BaseFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/BaseFragment.kt index 7306d4b..45c6832 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/BaseFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/BaseFragment.kt @@ -23,4 +23,6 @@ import androidx.fragment.app.Fragment /** * @author euxane */ -abstract class BaseFragment : Fragment() +abstract class BaseFragment : Fragment() { + protected val parentActivity by lazy { activity as BaseActivity } +} \ No newline at end of file -- cgit v1.2.3