Answers for "how to move from fragment to activity in kotlin"

0

how to go from fragment to another fragment in kotlin

purple.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {
        Fragment fragment = new tasks();
        FragmentManager fragmentManager = getActivity().getSupportFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        fragmentTransaction.replace(R.id.content_frame, fragment);
        fragmentTransaction.addToBackStack(null);
        fragmentTransaction.commit();
    }
});
Posted by: Guest on March-30-2021
0

how to move from fragment to activity in kotlin

btn.setOnClickListener {
            activity.let {
                val intent = Intent(it, GuardianProfile::class.java)
                startActivity(intent)
            }
        }
Posted by: Guest on May-24-2021

Code answers related to "how to move from fragment to activity in kotlin"

Browse Popular Code Answers by Language