Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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));
        }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #open #activity #click #button
ADD COMMENT
Topic
Name
9+3 =