Answers for "intent in kotlin android studio"

6

intent in fragment android

Button button = (Button) rootView.findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        Intent intent = new Intent(getActivity(), AnotherActivity.class);
        startActivity(intent);
    }
});
Posted by: Guest on June-15-2020
0

kotlin android intent pass data

//Send value from HomeActivity

val intent = Intent(this@HomeActivity,ProfileActivity::class.java)
intent.putExtra("Username","John Doe")
startActivity(intent)

//Get values in ProfileActivity

val profileName=intent.getStringExtra("Username")
Posted by: Guest on May-15-2020

Code answers related to "intent in kotlin android studio"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language