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

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 click of a button"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language