关于MediaPlayer没法停止

关于MediaPlayer无法停止

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

public class Activity01 extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

//从main.xml布局中获得Button对象
Button button_start = (Button)findViewById(R.id.start);
Button button_stop = (Button)findViewById(R.id.stop);
//设置按钮(Button)监听
button_start.setOnClickListener(start);
        button_stop.setOnClickListener(stop);

}

//开始按钮
private OnClickListener start = new OnClickListener()
    {
        public void onClick(View v)
        {   
         //开启Service
            startService(new Intent("com.yarin.Android.MUSIC"));
        }
    };
   //停止按钮
    private OnClickListener stop = new OnClickListener()
    {
        public void onClick(View v)
        {
         //停止Service
            stopService(new Intent("com.yarin.Android.MUSIC"));       
        }
    };

}



import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;
import android.util.Log;

public class MusicService extends Service{
private MediaPlayer player;

@Override
public IBinder onBind(Intent arg0) {
// TODO Auto-generated method stub
return null;
}

public void onStart(Intent intent, int startId){
super.onStart(intent, startId);
player = MediaPlayer.create(this, R.raw.test);
player.start();
}

public void onDestory(){
Log.d("aaa", "bbb");
super.onDestroy();
player.stop();
}
}

主要代码就是这样,我是用的2.2,就是通过服务来启动一个音频文件的播放/停止,现在是播放可以,但是停止不了,点了“停止”按钮没反应,不知为何啊,我打了Log发现也没进onDestory方法
------最佳解决方案--------------------
引用:
Note that if a stopped service still has ServiceConnection objects bound to it with the BIND_AUTO_CREATE set, it will not be destroyed until all of these bindings are removed. See the Service documen……


其实我2了,又想得太多。
只要把onDestroy()拼对就解决问题了。。。。。。。。。。。。。。。。
------其他解决方案--------------------
startService(new Intent("com.yarin.Android.MUSIC"));
改为startService(new Intent(this,MusicService.class));