Guest User

Untitled

a guest
Jul 17th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Button button;
  2.  
  3. protected void onCreate(Bundle savedInstanceState) {
  4. super.onCreate(savedInstanceState);
  5. setContentView(R.layout.activity_main);
  6.  
  7. button = (Button) findViewById(R.id.button);
  8. button.setOnClickListener(this);
  9. }
  10. public void onClick(View view) {
  11. switch (view.getId()) {
  12. case R.id.button:
  13. Intent intent = new Intent(this, Activity_2.class);
  14. startActivity(intent);
  15. break;
  16. default:
  17. break;
  18. }
  19. }
Add Comment
Please, Sign In to add comment