package chat.rocket.android.chatrooms.ui import android.os.Bundle import android.support.v4.app.Fragment import android.support.v7.app.AppCompatActivity import chat.rocket.android.R import chat.rocket.android.util.addFragment import dagger.android.AndroidInjection import dagger.android.AndroidInjector import dagger.android.DispatchingAndroidInjector import dagger.android.support.HasSupportFragmentInjector import javax.inject.Inject class MainActivity : AppCompatActivity(), HasSupportFragmentInjector { @Inject lateinit var fragmentDispatchingAndroidInjector: DispatchingAndroidInjector<Fragment> override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) AndroidInjection.inject(this) addFragment("ChatRoomsFragment", R.id.fragment_container) { ChatRoomsFragment.newInstance() } } override fun supportFragmentInjector(): AndroidInjector<Fragment> { return fragmentDispatchingAndroidInjector } }