只要我使用Android仿真程序来测试它,我的代码就能正常工作,但是一旦我构建了它并尝试在我的手机上使用它,我就会得到以下错误:
An uncaught Exception occurred onBad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Bad notification for startForeground: java.la
我正在后台服务中流式播放音乐。一切正常,除了当我从最近的应用程序列表中删除应用程序时,服务被销毁。当没有mediaplayer时,我用来使服务作为粘性运行的方法工作得很好。以下是我的代码
public class StreamListenerService extends Service implements MediaPlayer.OnPreparedListener,
如何在奥利奥后台运行服务?这个服务类在Oreo下面的所有Android版本中运行良好,我在清单中声明了这个服务。在我的活动类中,我使用startservice(getApplicationContext,ExoService.class)启动。exoPlayer.setPlayWhenReady(false);}*/
public ItemRadio getPlayingRadioStati