Answers for "open a new activity on button click android"

3

android how to start a new activity on button click

Intent intent = new Intent(this, ActivityToBeCalled.class);
startActivity(intent);
Posted by: Guest on August-22-2020
0

open a new activity on click of a button

Button btn = (Button)findViewById(R.id.open_activity_button);    

btn.setOnClickListener(new View.OnClickListener() {         
        @Override
        public void onClick(View v) {
            startActivity(new Intent(MainActivity.this, MyOtherActivity.class));
        }
});
Posted by: Guest on June-25-2021

Code answers related to "open a new activity on button click android"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language