Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Button button;
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- button = (Button) findViewById(R.id.button);
- button.setOnClickListener(this);
- }
- public void onClick(View view) {
- switch (view.getId()) {
- case R.id.button:
- Intent intent = new Intent(this, Activity_2.class);
- startActivity(intent);
- break;
- default:
- break;
- }
- }
Add Comment
Please, Sign In to add comment