Using as a whole feature with the default settings
This is the quickest way to start using the Community feature. All the default logic and navigations have already been defined.
Last updated
Was this helpful?
Was this helpful?
val intent = Intent(this, AmityCommunityHomePageActivity::class.java)
startActivity(intent)class MyCommunityHomeActivity: AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_my_community_home)
if(savedInstanceState == null) {
val fragmentManager = supportFragmentManager
val fragmentTransaction = fragmentManager.beginTransaction()
val fragment = createCommunityHomeFragment()
fragmentTransaction.replace(R.id.fragmentContainer, fragment)
fragmentTransaction.commit()
}
}
private fun createCommunityHomeFragment(): Fragment {
return AmityCommunityHomePageFragment.Builder().build(activity)
}
}