Answers for "start activity from fragment kotlin"

2

start new activity kotlin

val intent = Intent(this, NextActivity::class.java)
// To pass any data to next activity
intent.putExtra("keyIdentifier", value)
// start your next activity
startActivity(intent)
Posted by: Guest on March-03-2021
1

start fragment from activity

FragmentManager manager = getFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
transaction.add(R.id.container,YOUR_FRAGMENT_NAME,YOUR_FRAGMENT_STRING_TAG);
transaction.addToBackStack(null);
transaction.commit();
Posted by: Guest on November-06-2020
-1

how to start activity from fragment in kotlin

activity?.let{
    val intent = Intent (it, Main::class.java)
    it.startActivity(intent)
}
Posted by: Guest on February-15-2021

Code answers related to "start activity from fragment kotlin"

Browse Popular Code Answers by Language