小编Cha*_*Lee的帖子

程序包的开发人员警告,无法在通道 null 上发布通知,请参阅日志了解更多详细信息。祝酒留言

我的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)

notifications android

7
推荐指数
1
解决办法
4万
查看次数

标签 统计

android ×1

notifications ×1