我不断收到“无法解析方法创建(android.view.View.OnclickListner,?)”波浪线。我做错了什么方法似乎是正确的?但是我的应用程序出错了??
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button play = (Button)findViewById(R.id.button1);
play.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
MediaPlayer mp = MediaPlayer.create(MainActivity.this,R.raw.001);
}
});
}
}