package com.mycompany.myapp; import android.app.Activity; import android.os.Bundle; import android.widget.*; import android.view.View.*; import android.view.*; import android.content.*; import android.graphics.*; public class Autor extends Activity implements OnClickListener { Button button2, button1, button4, button3; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main2); button2 = (Button) findViewById(R.id.button2); button2.setOnClickListener(this); button1 = (Button) findViewById(R.id.button1); button1.setOnClickListener(this); button3 = (Button) findViewById(R.id.button3); button3.setOnClickListener(this); button4 = (Button) findViewById(R.id.button4); button4.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.button1: // setContentView(R.layout.help1); break; case R.id.button4: Intent intent= new Intent(this, MainActivity.class); startActivity(intent); // TODO Call second activity break; case R.id.button2: //setContentView(R.layout.help2); break; default: break; } } }