我的mp3播放器已经做好了。
它正在工作,但我总是收到一条祝酒消息
所以我想我需要在代码中设置通知通道。
但我不知道如何添加代码。帮我 !!
这是我的代码
public class MusicController extends MediaController {
public MusicController(Context c){
super(c);
}
public void hide(){}
}
public class MusicService extends Service implements
MediaPlayer.OnPreparedListener, MediaPlayer.OnErrorListener,
MediaPlayer.OnCompletionListener {
//media player
private MediaPlayer player;
//song list
private ArrayList<Song> songs;
//current position
private int songPosn;
//binder
private final IBinder musicBind = new MusicBinder();
//title of current song
private String songTitle="";
//notification id
private static final int NOTIFY_ID=1;
//shuffle flag and random
private boolean shuffle=false;
private Random rand;
public void …
Run Code Online (Sandbox Code Playgroud)