Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Button button;
- private Button button1;
- private Button button3;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- button = (Button)findViewById(R.id.button);
- button1 = (Button)findViewById(R.id.button3);
- button3 = (Button)findViewById(R.id.buttonx);
- button3.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- openActivityx();
- }
- });
- button.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- openActivity2();
- }
- });
- button1.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- openActivity3();
- }
- });
- }
- public void openActivity2(){
- Intent intent2 = new Intent(this, Activity2.class);
- startActivity(intent2);
- }
- public void openActivity3(){
- Intent intent = new Intent(this, Model3.class);
- startActivity(intent);
- }
- public void openActivityx(){
- Intent intent = new Intent(this , modelx.class);
- startActivity(intent);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement