Answers for "start new activity in 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
2

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();
        }
    });
Posted by: Guest on October-08-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 new activity in kotlin"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language