Try it out,
Button btt1 = (Button) findViewById(R.id.button1); btt1.setOnClickListener( View.OnClickListener() { public void onClick(View arg0) {
You should create btt1.setOnClickListener (View.OnClickListener () {
public void onClick(View arg0) {
the second java file looks like
public class second extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.secondx); } }
and you should create a secondx.xml file, and remember to add the expression below in the manifest
<activity :name=".second"> </activity>
good luck ...
source share