go to activity android
//going to another activity while ending the //previous one so that users cannot go back btListe = (ImageButton)findViewById(R.id.Button_Liste); btListe.setOnClickListener(new OnClickListener() { public void onClick(View v) { intent = new Intent(main.this, ListViewImage.class); startActivity(intent); finish(); } });
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(); } });
Source: stackoverflow.com
how to start activity from fragment in kotlin
activity?.let{ val intent = Intent (it, Main::class.java) it.startActivity(intent) }
Source: stackoverflow.com
goto activity from fragment intent in kotlin
val intent = Intent(context, NextActivity::class.java) startActivity(intent)