Building android application
<p>I am trying to build a simple application with a button "Play" for Android.In the MainActivty.java file,I get errors with the following code,so what do I need to rectify here?</p>

<pre><code>package com.example.simplemusicplayer;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}
}

Button playButton=(Button) findViewById(R.id.button1);
playButton.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v){
    //TODO Auto generated method stub
    Toast.makeText(MainActivity.this,"Starting to play",Toast.LENGTH_SHORT).show();       
}
});
}
}
</code></pre>
