Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Create a button that redirects to another activity in android studio

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));
        }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Create #button #redirects #activity #android #studio
ADD COMMENT
Topic
Name
3+8 =