From f35ff105e97eeaf0a67042a339689a981df05161 Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Tue, 7 Nov 2017 23:33:17 +0100 Subject: [PATCH] fix crash when AccountMediaFragment was recreated --- .../keylesspalace/tusky/fragment/AccountMediaFragment.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt index be1f45c60..785710c87 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/AccountMediaFragment.kt @@ -120,10 +120,9 @@ class AccountMediaFragment : BaseFragment() { } - override fun onAttach(context: Context) { - super.onAttach(context) - // we should get rid of this - api = (context as BaseActivity).mastodonApi + override fun onActivityCreated(savedInstanceState: Bundle?) { + super.onActivityCreated(savedInstanceState) + api = (activity as BaseActivity).mastodonApi } override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,