parent
a3ee13d767
commit
ce80b0c663
2 changed files with 12 additions and 3 deletions
|
@ -17,6 +17,7 @@ package com.keylesspalace.tusky.di
|
|||
|
||||
import android.app.Activity
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
|
@ -68,8 +69,7 @@ object AppInjector {
|
|||
if (activity is FragmentActivity) {
|
||||
activity.supportFragmentManager.registerFragmentLifecycleCallbacks(
|
||||
object : FragmentManager.FragmentLifecycleCallbacks() {
|
||||
override fun onFragmentCreated(fm: FragmentManager, f: Fragment,
|
||||
savedInstanceState: Bundle?) {
|
||||
override fun onFragmentPreAttached(fm: FragmentManager, f: Fragment, context: Context) {
|
||||
if (f is Injectable) {
|
||||
AndroidSupportInjection.inject(f)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue